SOURCES: saslauthd.init - use functions, fixed force-reload, added try-restart

qboosh qboosh at pld-linux.org
Sat May 31 14:22:29 CEST 2008


Author: qboosh                       Date: Sat May 31 12:22:28 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions, fixed force-reload, added try-restart

---- Files affected:
SOURCES:
   saslauthd.init (1.7 -> 1.8) 

---- Diffs:

================================================================
Index: SOURCES/saslauthd.init
diff -u SOURCES/saslauthd.init:1.7 SOURCES/saslauthd.init:1.8
--- SOURCES/saslauthd.init:1.7	Mon Sep 12 20:24:09 2005
+++ SOURCES/saslauthd.init	Sat May 31 14:22:22 2008
@@ -23,15 +23,7 @@
 	SASLAUTHD_OPTS="$SASLAUTHD_OPTS -O $SASL_RIMAP_HOSTNAME"
 fi
 
-#if is_yes "$SASL_TIME_OF_DAY_LOGIN_RESTRICTIONS" ; then
-#	SASLAUTHD_OPTS="$SASLAUTHD_OPTS -T"
-#fi
-
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
-	# Check if the service is already running?
+start() {
 	if [ ! -f /var/lock/subsys/saslauthd ]; then
 		msg_starting saslauthd
 		daemon saslauthd $SASLAUTHD_OPTS
@@ -40,9 +32,9 @@
 	else
 		msg_already_running saslauthd
 	fi
-	;;
-  stop)
-	# Stop daemons.
+}
+
+stop() {
 	if [ -f /var/lock/subsys/saslauthd ]; then
 		msg_stopping saslauthd
 		killproc saslauthd
@@ -50,18 +42,43 @@
 	else
 		msg_not_running saslauthd
 	fi
+}
+
+condrestart() {
+	if [ -f /var/lock/subsys/saslauthd ]; then
+		stop
+		start
+	else
+		msg_not_running saslauthd
+		RETVAL=$1
+	fi
+}
+
+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 saslauthd
 	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
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/saslauthd.init?r1=1.7&r2=1.8&f=u



More information about the pld-cvs-commit mailing list