]> git.pld-linux.org Git - packages/cpqarrayd.git/blobdiff - cpqarrayd.init
- removed duplicate force-reload
[packages/cpqarrayd.git] / cpqarrayd.init
index c66a4fc76e906144d26ad33fa46ff952a1b317d9..58324e8b74f57f5649f88c25d059766a0ac1a690 100644 (file)
@@ -17,10 +17,7 @@ if [ -f /etc/sysconfig/cpqarrayd ]; then
        . /etc/sysconfig/cpqarrayd
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/cpqarrayd ]; then
                msg_starting cpqarrayd
@@ -33,8 +30,9 @@ start)
        else
                msg_already_running cpqarrayd
        fi
-       ;;
-stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/cpqarrayd ]; then
                # Stop daemons.
                msg_stopping cpqarrayd
@@ -43,18 +41,45 @@ stop)
        else
                msg_not_running cpqarrayd
        fi
+}
+
+condrestart() {
+       if [ -f /var/lock/subsys/cpqarrayd ]; then
+               stop
+               start
+       else
+               if [ $1 -ne 0 ]; then
+                       msg_not_running cpqarrayd
+               fi
+               RETVAL=$1
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+start)
+       start
        ;;
-restart|reload|force-reload)
-       $0 stop
-       $0 start
-       RETVAL=$?
+stop)
+       stop
+       ;;
+restart)
+       stop
+       start
+       ;;
+try-restart)
+       condrestart 0
+       ;;
+force-reload)
+       condrestart 7
        ;;
 status)
        status cpqarrayd
        RETVAL=$?
        ;;
 *)
-       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
        exit 3
 esac
 
This page took 0.198052 seconds and 4 git commands to generate.