NUT losing connection w/ UPS when WAN disconnects
-
It seems like when my WAN connection is disrupted, NUT loses it's connection to my UPS. It is connected via a UPS cable.
Here is what I see in the system.log for NUT:
Sep 5 03:16:19 router upsmon[19781]: Signal 15: exiting Sep 5 03:16:19 router upsd[81948]: User local-monitor@::1 logged out from UPS [ups] Sep 5 03:16:19 router upsmon[18420]: upsmon parent: read Sep 5 03:16:19 router upsd[81948]: mainloop: Interrupted system call Sep 5 03:16:19 router upsd[81948]: Signal 15: exiting Sep 5 03:16:19 router usbhid-ups[75582]: Signal 15: exiting Sep 5 03:16:19 router upsmon[35121]: Startup successful Sep 5 03:16:19 router upsmon[35350]: UPS [ups]: connect failed: Connection failure: Connection refused Sep 5 03:16:19 router upsmon[35350]: Communications with UPS ups lost Sep 5 03:16:20 router usbhid-ups[94763]: Startup successful Sep 5 03:16:20 router upsd[22653]: listening on [LAN_GATEWAY_IP] port 3493 Sep 5 03:16:20 router upsd[22653]: listening on ::1 port 3493 Sep 5 03:16:20 router upsd[22653]: listening on 127.0.0.1 port 3493 Sep 5 03:16:20 router upsd[22653]: Connected to UPS [ups]: usbhid-ups-ups Sep 5 03:16:20 router upsd[25669]: Startup successful Sep 5 03:16:22 router upsmon[62915]: Startup successful Sep 5 03:16:22 router upsmon[63405]: UPS [ups]: connect failed: Connection failure: Connection refused Sep 5 03:16:22 router upsmon[63405]: Communications with UPS ups lost Sep 5 03:16:23 router upsd[93888]: listening on [LAN_GATEWAY_IP] port 3493 Sep 5 03:16:23 router upsd[93888]: listening on ::1 port 3493 Sep 5 03:16:23 router upsd[93888]: listening on 127.0.0.1 port 3493 Sep 5 03:16:23 router upsd[93888]: Can't connect to UPS [ups] (usbhid-ups-ups): Connection refused Sep 5 03:16:23 router upsd[94631]: Startup successful Sep 5 03:16:27 router upsd[94631]: Connected to UPS [ups]: usbhid-ups-ups Sep 5 03:16:27 router usbhid-ups[8366]: Startup successful Sep 5 03:16:27 router upsd[94631]: User local-monitor@::1 logged into UPS [ups] Sep 5 03:16:27 router upsmon[63405]: Communications with UPS ups established
A variation of that keeps repeating until the WAN is reconnected and then my connection to the UPS is re-established.
Any idea why this is happening or how I can prevent the WAN connection from impacting the UPS connection?
I have my UPS connected directly to pfSense, and then TrueNAS is a client to pfSense so that if I lose power, my TrueNAS server will initiate a shutdown if power is out for 5min. It looks like my router is configured to shutdown after 20 seconds (side question, any idea how to increase this to 15min/900 seconds?).
-
@RyanM This is normal. pfSense restarts packages when any interface changes link state.
To answer your other question, by default pfSense's NUT configuration will initiate a shutdown when the UPS declares a low battery situation. If your UPS is declaring a low battery condition in 20 seconds, it is likely that your UPS batteries need replacing.
Btw, using time based shutdown for your NAS will prevent automatic recovery of the NAS if power is restored before your UPS declares a low battery situation. I assume you already knew that, but I just wanted to make sure.
-
@dennypage I wasn't saying that my UPS declares low battery in 20 seconds, I was saying that the ups.delay.shutdown is set to 20, which I think means that if the UPS goes on battery power, after 20 seconds if the power is not restored, it will initiate a shutdown. Is that right?
I am not sure I want to set the NAS to power off on low battery. Will need to think about it. What is your reasoning on it?
-
@RyanM said in NUT losing connection w/ UPS when WAN disconnects:
I wasn't saying that my UPS declares low battery in 20 seconds, I was saying that the ups.delay.shutdown is set to 20, which I think means that if the UPS goes on battery power, after 20 seconds if the power is not restored, it will initiate a shutdown. Is that right?
No, that is not what the ups.delay.shutdown variable is. That variable controls how long the UPS waits to physically cut the power after being instructed to do so by software. It is used to allow the final stages of OS shutdown to complete before power is removed. In other words, the OS has 20 seconds to complete the 'power off' command before the UPS turns off.
I am not sure I want to set the NAS to power off on low battery. Will need to think about it. What is your reasoning on it?
Well, yes, you certainly want the NAS to power off when the UPS goes to low battery. If you don't then you are facing corruption.
My point was in response to you indicating "my TrueNAS server will initiate a shutdown if power is out for 5min." In this configuration, if the NAS shuts down after 5 minutes, but the UPS still has enough battery to last for a while longer, if the power comes back before the UPS declares a low battery state the NUT server on pfSense will never instruct the UPS to cut power. What this means is that your NAS will have turned off, and it will not turn back on again until you physically press its power switch.
-
@dennypage ok, this makes more sense. Thanks for clarifying.
-
@RyanM Welcome
-
@dennypage said in NUT losing connection w/ UPS when WAN disconnects:
This is normal. pfSense restarts packages when any interface changes link state
I know I this is a better safe then sorry solution, and not NUT's fault.
The system logs clearly shows "everything" get restarts.Still, NUT listening to 127.0.0.1 and LAN (192.168.1.1) is being restart because something happened "WAN", knowing that NUT has nothing to do with WAN, or any other interface, ... its somewhat bothering me, to say the least.
@dennypage : Again : not your issue.
Maybe I'm somewhat spoiled by other OS's like Debian who use 'smarter' /usr/local/erc/rc.d/ process start/stop files where dependencies are used. -