[Nut-upsuser] "Halt then reboot" script with systemd

Dark Penguin darkpenguin at yandex.ru
Wed Sep 7 09:52:44 UTC 2016

It's about that situation when power returns during the shutdown 
sequence, and the UPS ignores the "Kill power now!" command.

In Debian, there is an old workaround for this: the POWEROFF_WAIT 
option. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=358696 .

However, it does not work in Debian Stable (Jessie, NUT 2.7.2-4), 
apparently because systemd thinks it's smart enough to handle shutdown 
by itself. I wonder if it's even possible to implement this kind of 
thing with systemd?..

I believe it's worth doing this upstream - find and implement a single 
solution and not have everyone go through this on their own. The counter 
argument could be that systemd-based distributions can deal with it 
themselves, because NUT is not even Linux-only, but we're already 
changing to adapt to systemd - for example, the "nutshutdown" script 
), so it won't hurt to have another systemd problem solved upstream.

Should I maybe create an issue as a reminder for this, or is there 
already a solution in the newer versions?..

While I'm at it, I want to ask something. If I understand correctly, the 
problem is that if power returns during the shutdown procedure, then the 
command to "Cut the power now!" is ignored by the UPS, right? At least 
that's what my APC Smart-UPS SU1000 does. So, is it really considered 
"normal" that the UPS simply ignores a critical command like "CUT THE 
POWER!" just because the power is back already?.. Do all UPS do that?.. 
I just can not believe it, or understand the rationale for this 
behaviour. The power is back - and so what? The command is to turn the 
load off, and it has nothing to do with whether or not the power is 
back!.. Are we having this much trouble just because some (or all?) UPS 
manufacturers think it's okay to ignore critical commands whenever the 
UPS feels like it, because obviously the UPS is smarter than us and it 
knows better?.. They might as well install Windows on those UPS - that 
would be very appropriate with this approach!..


More information about the Nut-upsuser mailing list