#
# cyrus-imapd cyrus-imapd IMAP & POP3 Server
#
-# chkconfig: 345 85 15
+# chkconfig: 345 85 15
#
# description: cyrus-imapd
# 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
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
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
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
esac
exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4