[Nut-upsuser] turn UPS off after PC shutdown

Jim Klimov jimklimov+nut at gmail.com
Tue Jun 17 13:14:27 BST 2025


The file is created by `upsmon` (its half running as `root`) when it is
handling FSD situations and is a "primary" for some device(s).

Probably you can trigger one synthetically by `upsmon -c fsd`.

Jim


On Tue, Jun 17, 2025, 14:02 Dario Novakovic <darionis at yahoo.com> wrote:

> Exactly Jim,  this bothers me too much to give up :)
>
> My upsmon.conf *does contain* line: POWERDOWNFLAG /etc/killpower
>
> I checked for the existence of the file during shutdown with "/sbin/upsmon
> -K", and it exited with "1", meaning error: no POWERDOWNFLAG.
>
>
> It is actually Truenas 25.04, with NUT 2.8.0. This may be Truenas issue,
> but I would like to check NUT first.
>
> Now, for the logs: all I see about killpower is this line
>      nut-monitor[2688]: Using power down flag file /etc/killpower
> and it is logged when NUT service is starting. Thats all. No errors.
>
>
> I attached log of the shutdown procedure. Truenas is configured to
> shutdown in 60 seconds after power failure, and that is OK, but nothing
> about "killpower".
>
>
> Now I wonder what creates POWERDOWNFLAG, and why it is not created.  I
> attached shutdown log, removed uneeded lines. Truenas is configured to wait
> 60 seconds and if power is not restored it shuts down.
>
> Thanks,
> Dario
>
>
>
>
> On Monday, June 16, 2025 at 05:23:46 PM GMT+2, Jim Klimov <
> jimklimov+nut at gmail.com> wrote:
>
>
> >Cheers,
> >
> >  Your test results seem encouraging, so giving up now sounds unfortunate
> - perhaps just one more push is needed:
> >
> >* if `upsdrvctl shutdown` works, then at least basic driver settings in
> ups.conf (and driver+device) do suffice for the action;
> >* for a "killpower file", check that your upsmon.conf contains a line like
> >
> >POWERDOWNFLAG /etc/killpower
> >
> >** This line must be explicitly present (although a good path might be in
> a tmpfs, like /run/nut/killpower instead).
> >** Check upsmon logs - at least current NUT code should report if the
> value is defined or not, and if it failed to create the file for example.
> >
> >* For the file to have effect, it should be consulted during OS shutdown.
> I think you've never mentioned the OS nor NUT version, so details of this
> part are highly variable. In a Linux system with systemd and NUT v2.8.x,
> you would have a />usr/lib/systemd/system-shutdown/nutshutdown to call
> `upsdrvctl shutdown` when deemed needed.
> >
> >Jim
>
>
> On Mon, Jun 16, 2025, 14:11 Dario Novakovic via Nut-upsuser <
> nut-upsuser at alioth-lists.debian.net> wrote:
> > 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
> >
> > _______________________________________________
> > 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/20250617/50f26798/attachment-0001.htm>


More information about the Nut-upsuser mailing list