[Pkg-sysvinit-devel] Bug#577146: Logic of halt script, with regard to ups-monitor, is wrong
Regid Ichira
gl2n30y06arv2 at hotmail.com
Sat Apr 10 02:41:55 UTC 2010
Package: sysvinit
Version: 2.87dsf-10
Severity: important
Tags: patch
Suppose a user set HALT=poweroff in /etc/default/halt, and also
set /etc/init.d/ups-monitor because he has a ups. With the current
halt script, won't the end result be that the ups will always be
requested to cut the power?
--- halt 2010-04-10 05:24:57.000000000 +0200
+++ halt.mod 2010-04-10 05:25:37.000000000 +0200
@@ -17,6 +17,12 @@
. /lib/lsb/init-functions
do_stop () {
+ # See if we need to cut the power.
+ if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ]
+ then
+ /etc/init.d/ups-monitor poweroff
+ fi
+
if [ "$INIT_HALT" = "" ]
then
case "$HALT" in
@@ -32,12 +38,6 @@
esac
fi
- # See if we need to cut the power.
- if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ]
- then
- /etc/init.d/ups-monitor poweroff
- fi
-
# Don't shut down drives if we're using RAID.
hddown="-h"
if grep -qs '^md.*active' /proc/mdstat
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969
More information about the Pkg-sysvinit-devel
mailing list