#!/bin/sh # # imapd This shell script takes care of starting and stopping # imapd. Uses daemontools.functions for grunt work. # # chkconfig: 345 82 28 # description: imapd implements the IMAP protocol. You need to run \ # this to allow users to get mail from this server. # PROG=imapd DIR=/var/lock/$PROG # user settings . /etc/imapd.conf # Grab the daemontools init functions . /etc/rc.d/init.d/daemontools.functions start() { if check; then echo "$PROG is already running" else echo -n "Starting $PROG..." setsid \ /usr/lib/imap/setuplog "$LOGUSER" "$LOGDIR" "$LOGSIZE" '' "$LOGFIFO" \ supervise $DIR \ tcpserver \ -c $CONCURRENT \ -R -D \ $CDB_FLAG \ 0 $PORT \ /usr/sbin/imapd \ & echo "done" fi } case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) status ;; help) help ;; *) signal $1 ;; esac