]> git.pld-linux.org Git - packages/dovecot.git/commitdiff
- check daemon running state before reload
authorJakub Bogusz <qboosh@pld-linux.org>
Fri, 11 Jan 2008 21:17:09 +0000 (21:17 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- reload is supported, so handle force-reload likewise
- added try-restart action (LSB 3.1)

Changed files:
    dovecot.init -> 1.5

dovecot.init

index b193bbfdbf9af1c825f2761f44866e354db0d236..29abc7a3802678e19e7de2b6c72200d75cd1809f 100644 (file)
@@ -45,6 +45,27 @@ stop() {
        fi
 }
 
+reload() {
+       if [ -f /var/lock/subsys/dovecot ]; then
+               msg_reloading perlbal
+               killproc perlbal -HUP
+               RETVAL=$?
+       else
+               msg_not_running "Dovecot"
+               RETVAL=7
+       fi
+}
+
+condrestart() {
+       if [ -f /var/lock/subsys/dovecot ]; then
+               stop
+               start
+       else
+               msg_not_running "Dovecot"
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -54,21 +75,22 @@ case "$1" in
   stop)
        stop
        ;;
-  restart|force-reload)
+  restart)
        stop
        start
        ;;
-  reload)
-       msg_reloading "Dovecot"
-       killproc dovecot -HUP
-       exit $?
+  try-restart)
+       condrestart 0
+       ;;
+  reload|force-reload)
+       reload
        ;;
   status)
        status dovecot
        exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|reload|restart|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
        exit 3
 esac
 
This page took 0.128266 seconds and 4 git commands to generate.