From 90d879d90cc6a4fcef7fcfbe670145dd8ff77d8a Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Mon, 13 Feb 2012 12:07:52 +0100 Subject: Turn off UPS in powerfail situation (#754984, ) Patch by Robert Scheck for initscripts >= 9.03.23, which adds the required support for apcupsd to the halt initscript to turn off the UPS in case of a powerfail situation. --- rc.d/init.d/halt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index 45e37505..2ebdbbe3 100755 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -199,6 +199,11 @@ if [ "$command" = /sbin/halt -a -f /etc/sysconfig/ups ]; then fi fi +# Turn off UPS in powerfail situation +if [ -x /etc/apcupsd/apccontrol -a -f /etc/apcupsd/powerfail ]; then + /etc/apcupsd/apccontrol killpower +fi + # First, try kexec. If that fails, fall back to rebooting the old way. [ -n "$kexec_command" ] && $kexec_command -e -x >& /dev/null -- cgit v1.2.1