#!/bin/sh # /etc/rc.d/init.d/qmail # # description: Start, stop, restart, reload, and otherwise signal qmail. # # script modified by Vitaly Kushneriuk to support Gentoo init model. # script modified by Vincent Danen on July 17 2000 # revision: 10/12/00 - added qmail-pop3d support # 02/25/01 - added qmail-qmqpd support # - added support for split packages # PATH=/var/qmail/bin:/usr/local/bin:/usr/bin:/bin export PATH depend(){ need net } start(){ ebegin "Starting qmail supervise" cd /var/qmail/supervise env - PATH="$PATH" svscan & echo $! > /var/run/qmail-svscan.pid eend ${?} } stop(){ ebegin "Stopping qmail svscan" kill `cat /var/run/qmail-svscan.pid` eend 0 ebegin "Stopping qmail" svc -dx /var/qmail/supervise/* eend 0 ebegin "Stopping qmail logs" svc -dx /var/qmail/supervise/*/log eend 0 } stat(){ cd /var/qmail/supervise svstat * */log } alrm(){ echo "Sending ALRM signal to qmail-send." svc -a /var/qmail/supervise/qmail-send } doqueue(){ alrm } queue(){ qmail-qstat qmail-qread } reload(){ hup } hup(){ echo "Sending HUP signal to qmail-send." svc -h /var/qmail/supervise/qmail-send } pause(){ echo "Pausing qmail-send" svc -p /var/qmail/supervise/qmail-send echo "Pausing qmail-smtpd" svc -p /var/qmail/supervise/qmail-smtpd if [ -d /var/qmail/supervise/qmail-pop3d ]; then echo "Pausing qmail-pop3d" svc -p /var/qmail/supervise/qmail-pop3d fi if [ -d /var/qmail/supervise/qmail-qmqpd ]; then echo "Pausing qmail-qmqpd" svc -p /var/qmail/supervise/qmail-qmqpd fi } cont(){ echo "Continuing qmail-send" svc -c /var/qmail/supervise/qmail-send echo "Continuing qmail-smtpd" svc -c /var/qmail/supervise/qmail-smtpd if [ -d /var/qmail/supervise/qmail-pop3d ]; then echo "Continuing qmail-pop3d" svc -c /var/qmail/supervise/qmail-pop3d fi if [ -d /var/qmail/supervise/qmail-qmqpd ]; then echo "Continuing qmail-qmqpd" svc -c /var/qmail/supervise/qmail-qmqpd fi } opts="start stop stat restart alrm doqueue queue reload hup pause cont"