5 # description: IMAP Daemon
7 # Source function library
8 . /etc/rc.d/init.d/functions
11 . /etc/sysconfig/network
14 [ -f /etc/sysconfig/dovecot ] && . /etc/sysconfig/dovecot
16 # Check that networking is up.
17 if is_yes "${NETWORKING}"; then
18 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
19 msg_network_down "Dovecot"
26 if [ -n "${DOVECOT_CONF}" ]; then
27 if [ -f "${DOVECOT_CONF}" ]; then
28 DOVECOT_CFG="-c ${DOVECOT_CONF}"
30 echo "error: DOVECOT_CONF='$DOVECOT_CONF': not a file"
36 # Check if the service is already running?
37 if [ ! -f /var/lock/subsys/dovecot ]; then
38 msg_starting "Dovecot"
39 daemon /usr/sbin/dovecot $DOVECOT_CFG
41 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dovecot
43 msg_already_running "Dovecot"
48 if [ -f /var/lock/subsys/dovecot ]; then
49 msg_stopping "Dovecot"
50 killproc --pidfile dovecot/master.pid dovecot
51 rm -f /var/lock/subsys/dovecot
53 msg_not_running "Dovecot"
58 if [ -f /var/lock/subsys/dovecot ]; then
60 killproc --pidfile dovecot/master.pid docevot -HUP
63 msg_not_running "Dovecot"
69 if [ -f /var/lock/subsys/dovecot ]; then
73 msg_not_running "Dovecot"
79 # See how we were called.
102 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"