SOURCES: nscd.init - added try-restart, fixed force-reload

qboosh qboosh at pld-linux.org
Mon Nov 24 17:38:31 CET 2008


Author: qboosh                       Date: Mon Nov 24 16:38:31 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- added try-restart, fixed force-reload

---- Files affected:
SOURCES:
   nscd.init (1.15 -> 1.16) 

---- Diffs:

================================================================
Index: SOURCES/nscd.init
diff -u SOURCES/nscd.init:1.15 SOURCES/nscd.init:1.16
--- SOURCES/nscd.init:1.15	Wed Feb 28 22:04:02 2007
+++ SOURCES/nscd.init	Mon Nov 24 17:38:25 2008
@@ -44,18 +44,34 @@
 	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 @@
 		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
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/nscd.init?r1=1.15&r2=1.16&f=u



More information about the pld-cvs-commit mailing list