]> git.pld-linux.org Git - packages/daemontools.git/commitdiff
- add try-restart/force-reload
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 27 Apr 2008 00:33:58 +0000 (00:33 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    daemontools.init -> 1.17

daemontools.init

index 398f048fb916d58c898d747943098d015c876859..99c0fd034169e295c85853c6275621ee4aea834c 100644 (file)
@@ -57,7 +57,7 @@ stop() {
                svc=$(echo $SVSCAN_DIR/*)
                if [ "$svc" != "$SVSCAN_DIR/*" ]; then
                        svc -d -x $SVSCAN_DIR/* \
-                               $(find $SVSCAN_DIR/* -maxdepth 0 -follow -perm -1000|sed s-\$-/log-)
+                               $(find $SVSCAN_DIR/* -maxdepth 0 -follow -perm -1000 | sed -e 's-\$-/log-')
                fi
                rm -f /var/run/svscan.pid /var/lock/subsys/svscan >/dev/null 2>&1
        else
@@ -65,6 +65,16 @@ stop() {
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/svscan ]; then
+               stop
+               start
+       else
+               msg_not_running svscan
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -78,12 +88,18 @@ case "$1" in
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
   status)
        status svscan
        exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
        exit 3
 esac
 
This page took 0.118236 seconds and 4 git commands to generate.