Hi, all! Actually I have two questions for a same reason: I want to share my NUT to my LAN, or read UPS from remote device. /**************** firstly *****************/ I downloaded tcp-wrapper, but NUT could not detected it. Previously I successfully configured and make NUT into my embedded system. It worked and UPS is recognized. I downloaded tcp-wrapper (Ver 7.6, most files in the package are modified in 1997 or even earlier) and made it. It does not contained ./configure, and no "install" rule in Makefile, so I do not quite clear of whether I configured it right. I make tcp-wrappers as: # make \ REAL_DAEMON_DIR=/mnt/tmp \ CC=arm-mv5sft-linux-gnueabi-gcc \ EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED \ linux >libwrap_make.log # cp libwrap.a /lib # cp tcpd.h /usr/include -f And configure NUT as: ./configure \ --includedir=/usr/include \ --prefix=/usr/local/ups \ --exec-prefix=/usr/local/ups \ --bindir=/bin \ --sbindir=/sbin \ --sysconfdir=/etc \ --localstatedir=/var \ --libdir=/lib \ --build=i386 \ --host=arm-mv5sft-linux-gnueabi \ --libexecdir=/usr/local/usb \ --includedir=/usr/local/usb/include \ --with-usb-libs='-L/lib -lusb' \ --with-usb-includes=-I/usr/local/usb/prefix/include \ --with-user=root --with-group=root \ --with-usb=yes \ --with-wrap=yes \ --with-serial=no >>NUT_configure.log Then error occured. Three log file including configure.log attached. And is my configuration of tcp-wrapper right? I would confure something like libusb (--with-usb-libs, --with-usb-includes, etc) but there is only one configuration of libwrap (--with-wrap) and no more could be set. How should I correctly configure libwrap? Or I still need nore library? Currectly I only have libusb. /**************** secondly *****************/ NUT User Manual tells much about standalone mode of UPS support, but the one with server, it tells little. What I learned from several documents are: 1. upsd is a server, this "server" serves "client" but the common meaning of "net server". Which means upsd could not be seen by other device within the same LAN. 2. The real "net server" of UPS are drivers, such as usbhid-ups. The permission of access from network are done by tcp-wrapper. 3. If a slave device B wants to connect to a master device A with UPS plugged into, it just needs to run upsd with a "LISTEN <IP of A>" in upsd.conf Are they right? Thank you! -- Andrew Chang 2012-03-16 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20120316/e2c60bcc/attachment.html>
Sorry, I forgot the attachment. -------- Forwarding messages -------- From: "Andrew Min Chang" <laplacezhang at 126.com> Date: 2012-03-16 11:15:32 To: nut-upsuser <nut-upsuser at lists.alioth.debian.org> Subject: [NUT-upsuser] tcp-wrapper not found Hi, all! Actually I have two questions for a same reason: I want to share my NUT to my LAN, or read UPS from remote device. /**************** firstly *****************/ I downloaded tcp-wrapper, but NUT could not detected it. Previously I successfully configured and make NUT into my embedded system. It worked and UPS is recognized. I downloaded tcp-wrapper (Ver 7.6, most files in the package are modified in 1997 or even earlier) and made it. It does not contained ./configure, and no "install" rule in Makefile, so I do not quite clear of whether I configured it right. I make tcp-wrappers as: # make \ REAL_DAEMON_DIR=/mnt/tmp \ CC=arm-mv5sft-linux-gnueabi-gcc \ EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED \ linux >libwrap_make.log # cp libwrap.a /lib # cp tcpd.h /usr/include -f And configure NUT as: ./configure \ --includedir=/usr/include \ --prefix=/usr/local/ups \ --exec-prefix=/usr/local/ups \ --bindir=/bin \ --sbindir=/sbin \ --sysconfdir=/etc \ --localstatedir=/var \ --libdir=/lib \ --build=i386 \ --host=arm-mv5sft-linux-gnueabi \ --libexecdir=/usr/local/usb \ --includedir=/usr/local/usb/include \ --with-usb-libs='-L/lib -lusb' \ --with-usb-includes=-I/usr/local/usb/prefix/include \ --with-user=root --with-group=root \ --with-usb=yes \ --with-wrap=yes \ --with-serial=no >>NUT_configure.log Then error occured. Three log file including configure.log attached. And is my configuration of tcp-wrapper right? I would confure something like libusb (--with-usb-libs, --with-usb-includes, etc) but there is only one configuration of libwrap (--with-wrap) and no more could be set. How should I correctly configure libwrap? Or I still need nore library? Currectly I only have libusb. /**************** secondly *****************/ NUT User Manual tells much about standalone mode of UPS support, but the one with server, it tells little. What I learned from several documents are: 1. upsd is a server, this "server" serves "client" but the common meaning of "net server". Which means upsd could not be seen by other device within the same LAN. 2. The real "net server" of UPS are drivers, such as usbhid-ups. The permission of access from network are done by tcp-wrapper. 3. If a slave device B wants to connect to a master device A with UPS plugged into, it just needs to run upsd with a "LISTEN <IP of A>" in upsd.conf Are they right? Thank you! -- Andrew Chang 2012-03-16 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20120316/08497c49/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: attach.tar.gz Type: application/x-gzip Size: 4308 bytes Desc: not available URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20120316/08497c49/attachment.bin>
On Mar 15, 2012, at 11:15 PM, Andrew Min Chang wrote:> 1. upsd is a server, this "server" serves "client" but the common meaning of "net server". Which means upsd could not be seen by other device within the same LAN.No, see below.> 2. The real "net server" of UPS are drivers, such as usbhid-ups. The permission of access from network are done by tcp-wrapper.Permissions can be controlled by tcp_wrappers, but the actual network server is upsd. (Drivers communicate with upsd over a Unix-domain socket, which is local to the master system.)> 3. If a slave device B wants to connect to a master device A with UPS plugged into, it just needs to run upsd with a "LISTEN <IP of A>" in upsd.confCorrect. (This is why the LISTEN directive is in upsd.conf, not ups.conf.) Also, in most cases, tcp_wrappers can be replaced by kernel-level firewall rules. -- Charles Lepple clepple at gmail
Hi, Charles! Still, I am a little confused. Do you mean: If I want to make a machine A with a USB UPS physicaly plugged into share its UPS to other machines (for example, B) in the local network, I should run processes like this: 1. A runs driver, and then runs upsd with a config of "LISTEN 127.0.0.1" 2. B runs NO driver, but upsd with a config of "LISTEN <IP of A>" Meanwhile you mentioned that upsd is the network server. Do you mean that upsd on A servers the other upsd on B? -- Andrew Chang 2012-03-17 I meaned to try various configurations to examine my theory, but I still stucked in "tcp-wrapper not found". Cross compiling makes things totally different. PS: Is it better to send this question to nut-packager but nut-upsuser? At 2012-03-16 20:31:58,"Charles Lepple" <clepple at gmail.com> wrote:>On Mar 15, 2012, at 11:15 PM, Andrew Min Chang wrote: > >> 1. upsd is a server, this "server" serves "client" but the common meaning of "net server". Which means upsd could not be seen by other device within the same LAN. > >No, see below. > >> 2. The real "net server" of UPS are drivers, such as usbhid-ups. The permission of access from network are done by tcp-wrapper. > >Permissions can be controlled by tcp_wrappers, but the actual network server is upsd. (Drivers communicate with upsd over a Unix-domain socket, which is local to the master system.) > >> 3. If a slave device B wants to connect to a master device A with UPS plugged into, it just needs to run upsd with a "LISTEN <IP of A>" in upsd.conf > >Correct. (This is why the LISTEN directive is in upsd.conf, not ups.conf.) > >Also, in most cases, tcp_wrappers can be replaced by kernel-level firewall rules. > >-- >Charles Lepple >clepple at gmail > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20120317/f2e37b02/attachment.html>
Hi, Charles! I have an idea about my second problem below: If A runs driver, upsd, upsmon. Meanwhile B runs upsmon monitoring UPS of A. Is B able to get parameters of upsmon in A via common protocol of NUT? This might one way of the "Same as server". -- Andrew Chang 2012-03-20 At 2012-03-20 15:49:38,"Andrew Min Chang" <laplacezhang at 126.com> wrote: Hi, Charles! At 2012-03-20 10:55:34,"Charles Lepple" <clepple at gmail.com> wrote:> >From B, can you run "upsc MY_UPS at 192.168.1.100"? >Oh, yes! This command works! And the whole UPS status is listed. I always thought that "host name" is a "name" but IP address. As a result, I am comfused when I found no IP configuration in documents about upsmon. How fool I am! I ran the driver and upsd. The Synology machine also recognized the remote UPS device. Meanwhile I found something strange: There is a configuration named "Time before DiskStation enters Safe Mode", and one of its options is "Same as server". So, does upsd provide any functionality similar to this? Although this is not an critical problem in our project, I want to check this and I will try my best to provide a complete UPS service.> >I am almost certain that the board has some basic firewall capabilities that will do just that.>>There are many guides to iptables, e.g.: > >http://www.slackbook.org/html/security-host.html-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20120320/71b0b34a/attachment.html>