[Nut-upsuser] turn UPS off after PC shutdown

Jim Klimov jimklimov+nut at gmail.com
Thu Jun 12 20:30:34 BST 2025


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>


More information about the Nut-upsuser mailing list