On 12/10/2016 07:42 AM, Charles Lepple wrote:>> On Dec 9, 2016, at 10:40 PM, Jack McGee wrote: >> >> ? nut-server.service - LSB: Network UPS Tools initscript >> Loaded: loaded (/etc/init.d/nut-server; bad; vendor preset: enabled) >> Active: active (running) since Fri 2016-12-09 13:48:34 CST; 7h ago >> Docs: man:systemd-sysv-generator(8) >> Process: 1886 ExecStart=/etc/init.d/nut-server start (code=exited, status=0/SUCCESS) >> CGroup: /system.slice/nut-server.service >> ??2082 /lib/nut/usbhid-ups -a CyberUPS1 >> >> Dec 09 13:48:33 amethi systemd[1]: Starting LSB: Network UPS Tools initscript... >> Dec 09 13:48:33 amethi nut-server[1886]: * Starting NUT - power devices information server and drivers >> Dec 09 13:48:34 amethi usbhid-ups[2082]: Startup successful >> Dec 09 13:48:34 amethi upsd[2083]: not listening on 192.168.0.105 port 3493 >> Dec 09 13:48:34 amethi upsd[2083]: listening on 127.0.0.1 port 3493 >> Dec 09 13:48:34 amethi upsd[2083]: no listening interface available > Wait, when you say "NUT cannot connect to the UPS", which part are you referring to? > > The error you posted before from the driver looked like something else was already connected to the UPS. Only one copy of the driver can be running, and the log quoted above shows that it is (PID 2082). There is supposed to be logic in the driver to detect that a copy is already running, and to send a termination signal to that before trying to continue. > > However, if you get a "Connection Refused" error, then upsd is not listening on port 3493 yet. The last three lines above indicate that it couldn't bind to 192.168.0.105, so if a restart fixes that, then I guess systemd isn't properly waiting for the network to come up. Maybe someone else has a suggestion for that, but for me, the path of least resistance would be to listen on 0.0.0.0 and use a firewall rule to limit connections to that subnet.sorry, after reboot I started seeing this error in terminal: Broadcast message from nut at amethi (somewhere) (Sat Dec 10 08:05:01 2016): UPS CyberUPS1 at localhost is unavailable I had a similar issue I think when Ubuntu moved to SystemD with Mythtv not waiting to start until network was up and then erroring. I will see if I can recall what I did to fix that and apply it to NUT and see if that fixes it.
On 12/10/2016 08:10 AM, Jack McGee wrote:> e, the path of least resistance would be to listen on 0.0.0.0 and use > a firewall rule to limit connections to that subnet. > > > sorry, after reboot I started seeing this error in terminal: > > Broadcast message from nut at amethi (somewhere) (Sat Dec 10 08:05:01 2016): > > UPS CyberUPS1 at localhost is unavailable > > > I had a similar issue I think when Ubuntu moved to SystemD with Mythtv > not waiting to start until network was up and then erroring. I will > see if I can recall what I did to fix that and apply it to NUT and see > if that fixes it.Restart of nut-server after boot, fixes it: mythuser at amethi:~$ sudo systemctl status nut-server.service [sudo] password for mythuser: ? nut-server.service - LSB: Network UPS Tools initscript Loaded: loaded (/etc/init.d/nut-server; bad; vendor preset: enabled) Active: active (running) since Sat 2016-12-10 08:35:17 CST; 17s ago Docs: man:systemd-sysv-generator(8) Process: 16600 ExecStop=/etc/init.d/nut-server stop (code=exited, status=0/SUCCESS) Process: 16643 ExecStart=/etc/init.d/nut-server start (code=exited, status=0/SUCCESS) CGroup: /system.slice/nut-server.service ??16651 /lib/nut/usbhid-ups -a CyberUPS1 ??16653 /lib/nut/upsd Dec 10 08:35:17 amethi nut-server[16643]: * Starting NUT - power devices information server and drivers Dec 10 08:35:17 amethi usbhid-ups[16651]: Startup successful Dec 10 08:35:17 amethi upsd[16652]: listening on 192.168.0.105 port 3493 Dec 10 08:35:17 amethi upsd[16652]: listening on 127.0.0.1 port 3493 Dec 10 08:35:17 amethi upsd[16652]: Connected to UPS [CyberUPS1]: usbhid-ups-CyberUPS1 Dec 10 08:35:17 amethi upsd[16653]: Startup successful Dec 10 08:35:17 amethi nut-server[16643]: ...done. Dec 10 08:35:17 amethi systemd[1]: Started LSB: Network UPS Tools initscript. Dec 10 08:35:21 amethi upsd[16653]: User upsmon at 192.168.0.106 logged into UPS [CyberUPS1] Dec 10 08:35:21 amethi upsd[16653]: User upsmon at 127.0.0.1 logged into UPS [CyberUPS1]
On 12/10/2016 08:37 AM, Jack McGee wrote:> On 12/10/2016 08:10 AM, Jack McGee wrote: >> e, the path of least resistance would be to listen on 0.0.0.0 and use >> a firewall rule to limit connections to that subnet. >> >> >> sorry, after reboot I started seeing this error in terminal: >> >> Broadcast message from nut at amethi (somewhere) (Sat Dec 10 08:05:01 >> 2016): >> >> UPS CyberUPS1 at localhost is unavailable >> >> >> I had a similar issue I think when Ubuntu moved to SystemD with >> Mythtv not waiting to start until network was up and then erroring. >> I will see if I can recall what I did to fix that and apply it to NUT >> and see if that fixes it. > > Restart of nut-server after boot, fixes it: > > mythuser at amethi:~$ sudo systemctl status nut-server.service > [sudo] password for mythuser: > ? nut-server.service - LSB: Network UPS Tools initscript > Loaded: loaded (/etc/init.d/nut-server; bad; vendor preset: enabled) > Active: active (running) since Sat 2016-12-10 08:35:17 CST; 17s ago > Docs: man:systemd-sysv-generator(8) > Process: 16600 ExecStop=/etc/init.d/nut-server stop (code=exited, > status=0/SUCCESS) > Process: 16643 ExecStart=/etc/init.d/nut-server start (code=exited, > status=0/SUCCESS) > CGroup: /system.slice/nut-server.service > ??16651 /lib/nut/usbhid-ups -a CyberUPS1 > ??16653 /lib/nut/upsd > > Dec 10 08:35:17 amethi nut-server[16643]: * Starting NUT - power > devices information server and drivers > Dec 10 08:35:17 amethi usbhid-ups[16651]: Startup successful > Dec 10 08:35:17 amethi upsd[16652]: listening on 192.168.0.105 port 3493 > Dec 10 08:35:17 amethi upsd[16652]: listening on 127.0.0.1 port 3493 > Dec 10 08:35:17 amethi upsd[16652]: Connected to UPS [CyberUPS1]: > usbhid-ups-CyberUPS1 > Dec 10 08:35:17 amethi upsd[16653]: Startup successful > Dec 10 08:35:17 amethi nut-server[16643]: ...done. > Dec 10 08:35:17 amethi systemd[1]: Started LSB: Network UPS Tools > initscript. > Dec 10 08:35:21 amethi upsd[16653]: User upsmon at 192.168.0.106 logged > into UPS [CyberUPS1] > Dec 10 08:35:21 amethi upsd[16653]: User upsmon at 127.0.0.1 logged into > UPS [CyberUPS1]I put 0.0.0.0 in and took out 192.168.0.105 and on restart it works. The nut-server runs, and nut-client on another machine can reach it. This is not opened up to outside world so I should be OK until I figure out how to delay it until network is up. thanks.