<div dir="ltr"><div>Cool, congrats!<br><br></div><div>FWIW, with the current version it no longer aborts due to competition in this case:</div><div><br></div><div># upsmon -K<br>Network UPS Tools upsmon 2.8.3.4-4+g0264b1be1 (development iteration after 2.8.3)<br>Note: A previous upsmon instance is already running!<br>Usually it should not be running during OS shutdown,<br>which is when checking POWERDOWNFLAG makes most sense.<br>Using power down flag file /etc/killpower<br>Power down flag is not set<br></div><div><br></div><div>Jim</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Jun 18, 2025 at 3:30 PM Dario Novakovic via Nut-upsuser <<a href="mailto:nut-upsuser@alioth-lists.debian.net">nut-upsuser@alioth-lists.debian.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Ok, I've figured it out.<br>
<br>
<br>
File /etc/killpower actaully exists but command that is supposed to check for it (upsmon -K) incorrectly exits with "1". When I run that command in debug mode, it complained that nut service is still running<br>
So, it is some kind of timing problem "upsmon -K" is supposed to be run later in the shutdown procedure, when the nut service is stopped, I guess.<br>
<br>
$>upsmon -K<br>
Network UPS Tools upsmon 2.8.0<br>
Fatal error: A previous upsmon instance is already running!<br>
Either stop the previous instance first, or use the 'reload' command<br>
<br>
<br>
<br>
Anyway, I can check for the presence of the /etc/killpower file and turn the ups off, like it is suggested on the forums:<br>
if [ -f /etc/killpower ]; then until upsdrvctl shutdown; do sleep 1; done; fi<br>
<br>
This has to be added as "Trunas shutdown script".<br>
<br>
<br>
<br>
<br>
Thanks to Jim for inspiration :)<br>
<br>
Dario<br>
<br>
<br>
<br>
<br>
<br>
<br>
On Tuesday, June 17, 2025 at 02:12:35 PM GMT+2, Dario Novakovic via Nut-upsuser <<a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank">nut-upsuser@alioth-lists.debian.net</a>> wrote: <br>
<br>
<br>
Exactly Jim,  this bothers me too much to give up :)<br>
<br>
My upsmon.conf *does contain* line: POWERDOWNFLAG /etc/killpower<br>
<br>
I checked for the existence of the file during shutdown with "/sbin/upsmon -K", and it exited with "1", meaning error: no POWERDOWNFLAG.<br>
<br>
<br>
It is actually Truenas 25.04, with NUT 2.8.0. This may be Truenas issue, but I would like to check NUT first.<br>
<br>
Now, for the logs: all I see about killpower is this line<br>
     nut-monitor[2688]: Using power down flag file /etc/killpower<br>
and it is logged when NUT service is starting. Thats all. No errors.<br>
<br>
<br>
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".<br>
<br>
<br>
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.<br>
<br>
Thanks,<br>
Dario<br>
<br>
<br>
_______________________________________________<br>
Nut-upsuser mailing list<br>
<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
</blockquote></div>