[ -f /etc/sysconfig/courier-imap ] && . /etc/sysconfig/courier-imap
# Check that networking is up.
-if is_no "${NETWORKING}" ; then
- msg_network_down "Courier IMAP"
- exit 1
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network ]; then
+ msg_network_down "Courier IMAP"
+ exit 1
+ fi
+else
+ exit 0
fi
+RETVAL=0
# See how we were called.
case "$1" in
start)
if [ ! -f /var/lock/subsys/courier-imap ]; then
# start authdaemon, if not running..
if [ ! -f /var/lock/subsys/authdaemon -a \
- -x /etc/rc.d/init.d/authdaemon ]; then
- /etc/rc.d/init.d/authdaemon start
- RETVAL=$?
- if [ $RETVAL -ne 0 ]; then
- msg_starting "Courier IMAP"
- fail
- exit 1
- fi
+ -x /etc/rc.d/init.d/authdaemon ]; then
+ /etc/rc.d/init.d/authdaemon start
+ RETVAL=$?
+ if [ $RETVAL -ne 0 ]; then
+ msg_starting "Courier IMAP"
+ fail
+ exit 1
+ fi
fi
msg_starting "Courier IMAP"
+ busy
ulimit -d $IMAP_ULIMITD
/usr/bin/env - /bin/sh -c " . /etc/sysconfig/courier-imap ; \
`sed -n '/^#/d;/=/p' </etc/sysconfig/courier-imap | \
touch /var/lock/subsys/courier-imap
else
msg_already_running "Courier IMAP"
- exit 1
fi
;;
stop)
msg_stopping "Courier IMAP (SSL)"
daemon /usr/lib/courier-imap/couriertcpd -pid=/var/run/imapd-ssl.pid -stop
fi
- RETVAL=$?
rm -f /var/lock/subsys/courier-imap
else
msg_not_running "Courier IMAP"
- exit 1
fi
;;
- restart|reload)
+ restart|force-reload)
$0 stop
$0 start
+ exit $?
;;
status)
status couriertcpd
+ exit $?
;;
*)
- msg_usage "$0 {start|stop|restart|reload|status}"
- exit 1
+ msg_usage "$0 {start|stop|restart|force-reload|status}"
+ exit 3
esac
exit $RETVAL
-