]> git.pld-linux.org Git - packages/cyrus-imapd.git/commitdiff
- add try-restart
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 28 Apr 2008 13:27:44 +0000 (13:27 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    cyrus-imapd.init -> 1.11
    cyrus-sync.init -> 1.3

cyrus-imapd.init
cyrus-sync.init

index fd4eeb426676950810ffc257199e37c323129934..30f9824ba1de41767f4ddf2174ddc0327290acec 100644 (file)
@@ -50,6 +50,16 @@ stop() {
        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 @@ case "$1" in
   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
 
index 7149d06acc77b567c0b86c0036305ec8dc5f02ab..4cd90c4c434b1f23c201f6975fcc7b821582ca23 100644 (file)
@@ -57,6 +57,16 @@ stop() {
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/cyrus-sync ]; then
+               stop
+               start
+       else
+               msg_not_running cyrus-sync
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -66,16 +76,22 @@ case "$1" in
   stop)
        stop
        ;;
-  restart|force-reload)
+  restart)
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
   status)
        status cyrus-sync
        RETVAL=$?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
        exit 3
 esac
 
This page took 0.056409 seconds and 4 git commands to generate.