NUT: no restart of UPS

Started by Woi, May 19, 2021, 06:28:30 PM

Previous topic - Next topic
Hey OPNsenseis :)

I configured NUT with an Eaton 5PX UPS. On power loss OPNsens shuts down as expected, but doesn't switch of the UPS. If power returns before battery depletion, there is no power cycle and my OPNsense stays off. I did some investigation and believe this is a bug, but before writing a bug report, I like to have some confirmation of this behaviour from other users.

What I did for testing:

  • Pulled the power cord:
    OPNsense shuts down, UPS stayed on
  • ran upsdrvctl -t shutdown from shell as suggested in [1]: Output looked promising:
    Network UPS Tools - UPS driver controller 2.7.4
    *** Testing mode: not calling exec/kill
    [...]
       0.001167   Shutdown UPS: UPS_1
       0.001230   exec:  /usr/local/libexec/nut/usbhid-ups -a UPS_1 -k

  • ran upsmon -c fsd as suggested in [1]:
    OPNsense shutdown, UPS stayed on

  • ran upsdrvctl shutdown (without -t):
    OPNsense did not shutdown but UPS switched off after some delay as expected.
    Note: Maybe I ran usbhid-ups -k instead. I can't check because I lost my history for obvious reasons :)

This makes me believe os-nut is missing step 8 in init scripts as described in [2]. At least, I couldn't find the necessary bits.
If someone confirms this behaviour, I would create a bug report for it.


[1] https://networkupstools.org/docs/user-manual.chunked/ar01s06.html#Testing_shutdowns
[2] https://networkupstools.org/docs/user-manual.chunked/ar01s06.html#Shutdown_design

No reply yet? Maybe I should shorten my question:

Are your UPS outlets switched off after OPNsense shutdown or do your UPS outlets stay enabled after OPNsense shutdown?

I appreciate your posting about NUT as I have a different issue (probably my own doing, unsure at this point).  You might consider also posting at the link below.  I wish NUT was enhanced a bit more to include an option to shutdown after xx minutes of being on battery like my NAS units do.  I've looked at this for hours and can't figure out how to make this work.  Had a recent outage and OPNsense is a netclient, it reported battery low but didn't shutdown...didn't start to shutdown.  Log reported battery low, and then the UPS powered off about one minute later.  Cheers.

https://github.com/opnsense/plugins/issues
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT