File: //etc/rc.d/rc5.d/S54dovecot
#!/bin/sh
#
# Init file for Dovecot IMAP daemon
#
# chkconfig: 2345 54 46
# description: Dovecot IMAP Daemon
#
# processname: dovecot
# config: /etc/dovecot.conf
# pidfile: /var/run/dovecot
# source function library
. /etc/init.d/functions
[ -x /usr/sbin/dovecot ] || exit 1
RETVAL=0
#for systems that dont support 32768
ulimit -HSn 1024
ulimit -HSn 32768
start() {
echo -n $"Starting dovecot: "
daemon dovecot
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dovecot
return $RETVAL
}
stop() {
echo -n $"Shutting down dovecot: "
killproc dovecot
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dovecot
return $RETVAL
}
restart(){
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
condrestart)
[ -e /var/lock/subsys/dovecot ] && restart
RETVAL=$?
;;
status)
status dovecot
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
RETVAL=1
esac
exit $RETVAL