[packages/courier-authlib] init: add try-restart

glen glen at pld-linux.org
Thu Oct 29 13:42:04 CET 2015


commit 2376db480b3c97cfc6d9bcd87b5a5087864beeb4
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Oct 29 14:41:49 2015 +0200

    init: add try-restart

 courier-authlib.init | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/courier-authlib.init b/courier-authlib.init
index 6113933..2d2b6d0 100755
--- a/courier-authlib.init
+++ b/courier-authlib.init
@@ -62,6 +62,17 @@ reload() {
 	RETVAL=$?
 }
 
+condrestart() {
+	if [ ! -f /var/lock/subsys/courier-authlib ]; then
+		msg_not_running courier-authlib
+		RETVAL=$1
+		return
+	fi
+
+	stop
+	start
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -75,6 +86,9 @@ case "$1" in
   	stop
 	start
 	;;
+  try-restart)
+	condrestart 0
+	;;
   reload|force-reload|graceful)
 	reload
 	;;
@@ -83,7 +97,7 @@ case "$1" in
 	RETVAL=$?
 	;;
   *)
-	msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"
+	msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|try-restart|status}"
 	exit 3
 	;;
 esac
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/courier-authlib.git/commitdiff/2376db480b3c97cfc6d9bcd87b5a5087864beeb4



More information about the pld-cvs-commit mailing list