#!/bin/bash # Qmail startup file # # chkconfig: - 97 97 # description: Starts and stops the Qmail server. # # pidfile: /var/run/qmail.pid # # 12/20/2002 . /etc/rc.d/init.d/functions RETVAL=0 case "$1" in start) echo -n "Starting qmail: " daemon /var/qmail/rc RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/qmail echo ;; stop) echo -n "Shutting down qmail: " killproc qmail-lspawn RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/qmail echo ;; restart) $0 stop $0 start RETVAL=$? ;; status) status qmail RETVAL=$? ;; *) echo "Usage: qmail {start|stop|restart|status}" exit 1 esac exit $RETVAL