]> git.pld-linux.org Git - packages/cyrus-imapd.git/blobdiff - cyrus-imapd.init
- fix building with BerkleyDB 4.5
[packages/cyrus-imapd.git] / cyrus-imapd.init
index 762bde82dcb4e02022af6764d12aa455431cdf5d..fd4eeb426676950810ffc257199e37c323129934 100644 (file)
@@ -2,7 +2,7 @@
 #
 # cyrus-imapd  cyrus-imapd IMAP & POP3 Server
 #
-# chkconfig:    345  85 15
+# chkconfig:   345 85 15
 #
 # description: cyrus-imapd
 
@@ -14,7 +14,7 @@
 
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
-       if [ ! -f /var/lock/subsys/network ]; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
                msg_network_down cyrus-imapd
                exit 1
        fi
@@ -22,10 +22,7 @@ else
        exit 0
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/cyrus-imapd ]; then
                msg_starting cyrus-imapd
@@ -38,11 +35,11 @@ case "$1" in
                        fail
                fi
        else
-               # show "%s service is already running." <service>
                msg_already_running cyrus-imapd
        fi
-       ;;
-  stop)
+}
+
+stop() {
        # Stop daemons.
        if [ -f /var/lock/subsys/cyrus-imapd ]; then
                msg_stopping cyrus-imapd
@@ -50,12 +47,21 @@ case "$1" in
                rm -f /var/lock/subsys/cyrus-imapd
        else
                msg_not_running cyrus-imapd
-       fi      
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   restart|force-reload)
-       $0 stop
-       $0 start
-       RETVAL=$?
+       stop
+       start
        ;;
   status)
        status cyrus-master
@@ -67,6 +73,3 @@ case "$1" in
 esac
 
 exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.129071 seconds and 4 git commands to generate.