]> git.pld-linux.org Git - packages/apcupsd.git/blobdiff - apcupsd.init
- fixed build (spec syntax)
[packages/apcupsd.git] / apcupsd.init
index 99b81cfea47193b64536d1881056cc43e02afe8a..f75e44b7420c5ec0f57521aba393cbc73fb91e62 100644 (file)
@@ -1,10 +1,10 @@
 #! /bin/sh
 #
-# apcupsd      This shell script takes care of starting and stopping
-#             the apcupsd UPS monitoring daemon.
+# apcupsd      This shell script takes care of starting and stopping
+#              the apcupsd UPS monitoring daemon.
 #
-# chkconfig: 2345 60 99
-# description: apcupsd monitors power and takes action if necessary
+# chkconfig:   2345 60 99
+# description: apcupsd monitors power and takes action if necessary
 
 # Source function library
 . /etc/rc.d/init.d/functions
@@ -22,6 +22,11 @@ else
        exit 0
 fi
 
+# Get service config
+if [ -f /etc/sysconfig/apcupsd ]; then
+        . /etc/sysconfig/apcupsd
+fi
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -29,8 +34,8 @@ case "$1" in
        rm -f /etc/apcupsd/powerfail
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/apcupsd ]; then
-               show "Starting APC UPS monitoring"
-               daemon /usr/sbin/apcupsd -f /etc/apcupsd/apcupsd.conf
+               msg_starting "APC UPS monitoring"
+               daemon $SERVICE_RUN_NICE_LEVEL /usr/sbin/apcupsd -f /etc/apcupsd/apcupsd.conf
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/apcupsd
        else
@@ -46,9 +51,9 @@ case "$1" in
                msg_not_running "APC UPS monitoring"
        fi
        ;;
-  restart)
+  restart|force-reload)
        $0 stop
-               $0 start
+       $0 start
        ;;
   powerdown)
        if [ -f /etc/apcupsd/powerfail ]; then
@@ -62,7 +67,7 @@ case "$1" in
        /usr/sbin/apcaccess status
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|status|powerdown}"
+       msg_usage "$0 {start|stop|restart|force-reload|status|powerdown}"
        exit 3
 esac
 
This page took 0.042258 seconds and 4 git commands to generate.