]> git.pld-linux.org Git - packages/dante.git/blobdiff - sockd.init
Release 6 (by relup.sh)
[packages/dante.git] / sockd.init
index ce181a6062da2973059a2af834b1f56932cdf12f..df5d55444b6bacbf564c0fc78876f51d8aa85ba7 100644 (file)
@@ -21,8 +21,7 @@
 
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
-       if [ ! -f /var/lock/subsys/network ]; then
-               # nls "ERROR: Networking is down. %s can't be run." <service>
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
                msg_network_down sockdd
                exit 1
        fi
@@ -30,10 +29,7 @@ else
        exit 0
 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/sockd ]; then
                msg_starting sockd
@@ -43,9 +39,9 @@ case "$1" in
        else
                msg_already_running sockd
        fi
-       ;;
-  stop)
-       # Stop daemons.
+}
+
+stop() {
        if [ -f /var/lock/subsys/sockd ]; then
                msg_stopping sockd
                killproc sockd
@@ -53,18 +49,43 @@ case "$1" in
        else
                msg_not_running sockd
        fi
+}
+
+condrestart() {
+       if [ ! -f /var/lock/subsys/sockd ]; then
+               msg_not_running sockd
+               RETVAL=$1
+               return
+       fi
+       stop
+       start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
        ;;
   status)
        status sockd
        exit $?
        ;;
-  restart|force-reload)
-       $0 stop
-       $0 start
-       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.079864 seconds and 4 git commands to generate.