#!/bin/sh # # qmail This shell script takes care of starting and stopping # qmail. # # chkconfig: 2345 80 19 # description: qmail is a Mail Transport Agent, which is the program \ # that moves mail from one machine to another. # processname: qmail # config: /var/qmail/control/ # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network export PATH=$PATH:/var/qmail/bin # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 [ -f /usr/sbin/sendmail ] || exit 0 # See how we were called. case "$1" in start) # Start daemons. echo -n "Starting qmail: " qmail-start ./Maildir/ splogger qmail & QMAILPID=`pidofproc qmail-lspawn` base=qmail-lspawn if [ -z "$QMAILPID" ]; then failure $"$base startup" else touch /var/lock/subsys/qmail success $"$base startup" fi echo ;; stop) # Stop daemons. echo -n "Shutting down qmail: " killproc qmail-lspawn echo rm -f /var/lock/subsys/qmail ;; restart) $0 stop $0 start ;; status) status qmail-lspawn ;; *) echo "Usage: qmail {start|stop|restart|status}" exit 1 esac exit 0