SOURCES: rpcgssd.init - use functions

glen glen at pld-linux.org
Fri Apr 6 12:23:33 CEST 2007


Author: glen                         Date: Fri Apr  6 10:23:33 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   rpcgssd.init (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: SOURCES/rpcgssd.init
diff -u SOURCES/rpcgssd.init:1.6 SOURCES/rpcgssd.init:1.7
--- SOURCES/rpcgssd.init:1.6	Fri Apr  6 01:43:11 2007
+++ SOURCES/rpcgssd.init	Fri Apr  6 12:23:27 2007
@@ -37,11 +37,7 @@
 # /usr may be on NFS, fail silently, nfsfs will start it
 [ -x /usr/sbin/rpc.gssd ] || exit 0
 
-RETVAL=0
-
-# See how we were called.
-case "$1" in
-  start)
+start() {
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/gssd ]; then
 		if ! grep -q rpc_pipefs /proc/mounts ; then
@@ -60,8 +56,9 @@
 	else
 		msg_already_running "RPC gssd"
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/gssd ]; then
 		msg_stopping "RPC gssd"
 		killproc rpc.gssd
@@ -69,15 +66,24 @@
 	else
 		msg_not_running "RPC gssd"
 	fi
+}
+
+# See how we were called.
+RETVAL=0
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   status)
 	status rpc.gssd
 	RETVAL=$?
 	;;
   restart|reload)
-	$0 stop
-	$0 start
-	RETVAL=$?
+	stop
+	start
 	;;
   *)
 	msg_usage "$0 {start|stop|restart|status}"
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/rpcgssd.init?r1=1.6&r2=1.7&f=u



More information about the pld-cvs-commit mailing list