I am using truenas with?Cyber power CP900EPFCLCD UPS. All is well, server shuts down after power loss in specified time. Problem is that UPS remains ON. I would like UPS to turn OFF and I will turn it on, when the power comes back. I tried many various configuration but it does not affect the UPS. Before I send all my config files and everything, I would like to understand how it works.? I have been messing with nut for days, setting various "delay"s, tried many different settings and configs but I feel like I am missing something. I have couple of general questions: 1. Is it possible to turn the UPS off, after PC shut down. 2. If yes, how does it work? What makes UPS go off, when PC is off? What kind of command or information is sent to UPS to make it turn off 3. What is the purpose of "ups.delay.shutdown". Documentation says "Interval to wait after shutdown with delay command (seconds)". "Wait" for what exactly? Thanks, Dario
Primarily this depends on UPS abilities, whether its firmware allows such operation and implements the (delayed) UPS shutdown. Also this needs NUT drivers' INSTCMD support, there are several names for similar operations though (load.off , ups.shutdown.stayoff, ups.shutdown.reboot, etc.) For CPS, see also https://github.com/networkupstools/nut/wiki/CyberPower-Systems-(CPS)-know-how - there are nuances about delay/time specification (IIRC each whole 60sec is what matters). Generally this works like this: * driver reports that the UPS is in a critical state (e.g. on battery and low battery) * upsmon client which is "primary" for the UPS populates a "killpower" file and begins usual system shutdown * init-script or service integration should have a NUT shutdown hook script, late in the shutdown routine (maybe after most filesystems are remounted read-only or unmounted), which finds the "killpower" file and re-runs the NUT driver to command the UPS to power off, possibly with a delay * UPS controller handles this - e.g. sleeps some more to let the OS to shut down completely, and turns off the load and/or inverter * when wall power comes back, the UPS usually powers on automatically (maybe after charging to a safe level), gives power to the load, computer turns on (if BIOS settings tell it to always turn on when power appears) Jim On Thu, Jun 12, 2025 at 5:15?PM Dario Novakovic via Nut-upsuser < nut-upsuser at alioth-lists.debian.net> wrote:> I am using truenas with Cyber power CP900EPFCLCD UPS. All is well, server > shuts down after power loss in specified time. > > Problem is that UPS remains ON. I would like UPS to turn OFF and I will > turn it on, when the power comes back. I tried many various configuration > but it does not affect the UPS. > > Before I send all my config files and everything, I would like to > understand how it works. > > I have been messing with nut for days, setting various "delay"s, tried > many different settings and configs but I feel like I am missing something. > I have couple of general questions: > > 1. Is it possible to turn the UPS off, after PC shut down. > 2. If yes, how does it work? What makes UPS go off, when PC is off? What > kind of command or information is sent to UPS to make it turn off > 3. What is the purpose of "ups.delay.shutdown". Documentation says > "Interval to wait after shutdown with delay command (seconds)". "Wait" for > what exactly? > > > Thanks, > Dario > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20250612/a640bc53/attachment.htm>
On 6/12/25 14:30, Jim Klimov via Nut-upsuser wrote:> Primarily this depends on UPS abilities, whether its firmware allows such operation and implements the (delayed) UPS shutdown. > Also this needs NUT drivers' INSTCMD support, there are several names for similar operations though (load.off , ups.shutdown.stayoff, ups.shutdown.reboot, etc.) > > For CPS, see also https://github.com/networkupstools/nut/wiki/CyberPower-Systems-(CPS)-know-how <https://github.com/networkupstools/nut/wiki/CyberPower-Systems-(CPS)-know-how> - there are nuances about delay/time specification (IIRC each whole 60sec is what matters). > > Generally this works like this: > * driver reports that the UPS is in a critical state (e.g. on battery and low battery) > * upsmon client which is "primary" for the UPS populates a "killpower" file and begins usual system shutdown > * init-script or service integration should have a NUT shutdown hook script, late in the shutdown routine (maybe after most filesystems are remounted read-only or unmounted), which finds the "killpower" file and re-runs the NUT driver to command the UPS to power off, possibly with a delay > * UPS controller handles this - e.g. sleeps some more to let the OS to shut down completely, and turns off the load and/or inverter > * when wall power comes back, the UPS usually powers on automatically (maybe after charging to a safe level), gives power to the load, computer turns on (if BIOS settings tell it to always turn on when power appears) > > JimThe way I've always handled it is to tell the system to reboot, rather than shutdown (SHUTDOWNCMD "/sbin/shutdown -r +0") and then set "POWEROFF_WAIT=0" in nut.conf. That handles the corner case of AC line power coming back on during the time the OS is shutting down. If that does happen, the system simply reboots and is not left sitting there halted forever. In the usual case of line power remaining off, the system gets its power cord yanked out while the firmware is trying to reboot, and then will actually boot when power is restored. Works for me. YMMV. -- Bob Nichols "NOSPAM" is really part of my email address. Do NOT delete it.
Thanks Jim and Robert! I confirmed that ups understands "turn off" request from the PC, with "upsdrvctl shutdown". However, I am not sure if "killpower" file is created, when ups goes on battery. On the other hand I am not sure how CyberPower UPS interprets config params: offdelay, ups.delay.shutdown, ups.timer.shutdown. I have been through so many docs, forums, issue reports, etc. This is so confusing and messy, I am giving up. Thanks all, Dario On Thursday, June 12, 2025 at 05:15:02 PM GMT+2, Dario Novakovic via Nut-upsuser <nut-upsuser at alioth-lists.debian.net> wrote: I am using truenas with?Cyber power CP900EPFCLCD UPS. All is well, server shuts down after power loss in specified time. Problem is that UPS remains ON. I would like UPS to turn OFF and I will turn it on, when the power comes back. I tried many various configuration but it does not affect the UPS. Before I send all my config files and everything, I would like to understand how it works.? I have been messing with nut for days, setting various "delay"s, tried many different settings and configs but I feel like I am missing something. I have couple of general questions: 1. Is it possible to turn the UPS off, after PC shut down. 2. If yes, how does it work? What makes UPS go off, when PC is off? What kind of command or information is sent to UPS to make it turn off 3. What is the purpose of "ups.delay.shutdown". Documentation says "Interval to wait after shutdown with delay command (seconds)". "Wait" for what exactly? Thanks, Dario _______________________________________________ Nut-upsuser mailing list Nut-upsuser at alioth-lists.debian.net https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser