SOURCES: cyrus-imapd.init - add try-restart

glen glen at pld-linux.org
Mon Apr 28 15:24:38 CEST 2008


Author: glen                         Date: Mon Apr 28 13:24:38 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- add try-restart

---- Files affected:
SOURCES:
   cyrus-imapd.init (1.10 -> 1.11) 

---- Diffs:

================================================================
Index: SOURCES/cyrus-imapd.init
diff -u SOURCES/cyrus-imapd.init:1.10 SOURCES/cyrus-imapd.init:1.11
--- SOURCES/cyrus-imapd.init:1.10	Mon Mar 26 18:04:49 2007
+++ SOURCES/cyrus-imapd.init	Mon Apr 28 15:24:32 2008
@@ -50,6 +50,16 @@
 	fi
 }
 
+condrestart() {
+	if [ -f /var/lock/subsys/cyrus-imapd ]; then
+		stop
+		start
+	else
+		msg_not_running cyrus-imapd
+		RETVAL=$1
+	fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -59,16 +69,22 @@
   stop)
   	stop
 	;;
-  restart|force-reload)
+  restart)
 	stop
 	start
+  try-restart)
+	condrestart 0
+	;;
+	;;
+  force-reload)
+	condrestart 7
 	;;
   status)
 	status cyrus-master
 	RETVAL=$?
 	;;
   *)
-	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/cyrus-imapd.init?r1=1.10&r2=1.11&f=u



More information about the pld-cvs-commit mailing list