]> git.pld-linux.org Git - packages/glibc.git/commitdiff
- added try-restart, fixed force-reload
authorJakub Bogusz <qboosh@pld-linux.org>
Mon, 24 Nov 2008 16:38:25 +0000 (16:38 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    nscd.init -> 1.16

nscd.init

index c225990cf4b994b2b934371be8cef17338765ac6..75725ef886f239282dd9b7ecad72af2478636652 100644 (file)
--- a/nscd.init
+++ b/nscd.init
@@ -44,18 +44,34 @@ stop() {
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/nscd ]; then
+               stop
+               start
+       else
+               msg_not_running "Name Switch Cache Daemon"
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
   start)
-       start
+       start
        ;;
   stop)
-       stop
+       stop
        ;;
-  status)
-       status nscd
-       exit $?
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
        ;;
   reload)
        if [ -f /var/lock/subsys/nscd ]; then
@@ -67,12 +83,12 @@ case "$1" in
                msg_not_running "Name Switch Cache Daemon"
        fi
        ;;
-  restart|force-reload)
-       stop
-       start
+  status)
+       status nscd
+       exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
        exit 3
 esac
 
This page took 0.179252 seconds and 4 git commands to generate.