Background: When wall power fails a UPS unit will shut down a simple
desktop PC, and this is sufficient, but shutting down a server is more
complex. It must be shut down in such a way that when wall power
returns, the server is turned back on again* without human
The technique for doing this relies on
a UPS unit which detects that wall power has come back and restarts the server.
A server BIOS setting which turns on the server when power returns.
For this process to work, the UPS unit must receive a
delayed-UPS-shutdown signal which will put it into a state where it
will operate as in 1) above. A UPS unit which is simply left
“beeping” will not restart its load when wall power returns.
Problem: Up to release 12.1, the software in the NUT upsd package
handled this correctly, provided that it was correctly configured. In
12.2 this no longer happens. Even if NUT upsd is correctly
configured, the openSUSE script rcupsd->/etc/init.d/upsd does not shut
down the UPS unit. It should call NUT program “upsdrvctl shutdown”
but doesn’t. Looking at file /etc/sysconfig/shutdown,
# Hook during system shutdown to run extra command
it looks as if the intended sequence is “rcupsd try-powerdown” which
calls “rcupsd powerdown” which calls “upsdrvctl shutdown”. Currently
rcupsd attempts to call “try-powerdown”, but “try-powerdown” always
fails silently because $RUNLEVEL and $UPSD_POWERDOWN_CONDITION are
empty. /etc/init.d/upsd powerdown is never called.
In /etc/sysconfig/shutdown I specified
reran command SuSEconfig, and tried again but there was no change.
However typing the command /etc/init.d/upsd powerdown does shut down
the UPS unit.
Fix: There is a file /etc/init.d/halt.local which is currently empty:
# script with local commands to be executed from init on system shutdown
# Here you should add things, that should happen directly before shuting
I added the lines
# 2012-10-28 Turn off the UPS unit. See http://rogerprice.org/NUT.html
# Needed for automatic system restart when wall power returns.
echo `date -I` `date +%T` "$0 calls $UPSDRVCTL_BIN shutdown" >> /var/log/halt.local
Test: I pulled the plug from the wall and witnessed a server shutdown
followed 10 seconds later by a UPS shutdown. Pushing the plug back
into the wall got the UPS and then the system running again.