Blob Blame History Raw
diff -up apcupsd-3.14.5/platforms/redhat/apcupsd.in.init apcupsd-3.14.5/platforms/redhat/apcupsd.in
--- apcupsd-3.14.5/platforms/redhat/apcupsd.in.init	2008-11-01 16:03:26.000000000 +0100
+++ apcupsd-3.14.5/platforms/redhat/apcupsd.in	2009-01-22 10:58:00.429886991 +0100
@@ -3,9 +3,19 @@
 # apcupsd      This shell script takes care of starting and stopping
 #	       the apcupsd UPS monitoring daemon.
 #
-# chkconfig: 2345 60 99
+# chkconfig: - 60 99
 # description: apcupsd monitors power and takes action if necessary
 #
+### BEGIN INIT INFO
+# Provides: apcupsd
+# Required-Start: $syslog $local_fs
+# Required-Stop: $syslog $local_fs
+# Default-Start:
+# Default-Stop: 0 1 6
+# Short-Description: apcupsd daemon
+# Description: APC UPS Power Control Daemon for Linux
+### END INIT INFO
+
 APCPID=@PIDDIR@/apcupsd.pid
 
 # Source function libarary
@@ -30,9 +40,11 @@ case "$1" in
        ;;
     restart|force-reload)
        $0 stop
-       sleep 15
        $0 start
        ;;
+    condrestart)
+       [ -f @LOCKDIR@/subsys/apcupsd ] && $0 restart || :
+       ;;
     reload)
        echo "$0: reload not implemented"
        exit 3
@@ -48,7 +60,7 @@ case "$1" in
        fi
        ;;
     *)
-       echo "Usage: $0 {start|stop|restart|status}"
+       echo "Usage: $0 {start|stop|restart|condrestart|status}"
        exit 1
        ;;
 esac