aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2012-02-13 12:07:52 +0100
committerLukas Nykryn <lnykryn@redhat.com>2012-02-13 12:09:46 +0100
commit90d879d90cc6a4fcef7fcfbe670145dd8ff77d8a (patch)
tree78d0a6af67c380620274c5073d87e6829dac2f40 /rc.d/init.d
parent5fd213f7e38beb82c6cb9e70258417473e45fec0 (diff)
downloadinitscripts-90d879d90cc6a4fcef7fcfbe670145dd8ff77d8a.tar
initscripts-90d879d90cc6a4fcef7fcfbe670145dd8ff77d8a.tar.gz
initscripts-90d879d90cc6a4fcef7fcfbe670145dd8ff77d8a.tar.bz2
initscripts-90d879d90cc6a4fcef7fcfbe670145dd8ff77d8a.tar.xz
initscripts-90d879d90cc6a4fcef7fcfbe670145dd8ff77d8a.zip
Turn off UPS in powerfail situation (#754984, <robert@fedoraproject.org>)
Patch by Robert Scheck <robert@fedoraproject.org> 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.
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-xrc.d/init.d/halt5
1 files changed, 5 insertions, 0 deletions
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