Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


qmailctl? | 11 comments | Create New Account
Click here to return to the 'qmailctl?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
qmailctl?
Authored by: bluehz on Oct 03, '03 08:32:48AM
Here is the qmailctl file I use on my Linux qmail install. It is actually for RedHat, and I think I modified it slightly for my Slackware Linux install. This is also setup to use daemontools (hence the svc, svstat, etc)

#!/bin/sh

# For Red Hat chkconfig
# chkconfig: - 30 80
# description: the qmail MTA

PATH=/var/qmail/bin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin
export PATH

QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`

case "$1" in
  start)
    echo "Starting qmail"
    if svok /service/qmail-send ; then
      svc -u /service/qmail-send
    else
      echo qmail-send service not running
    fi
    if svok /service/qmail-smtpd ; then
      svc -u /service/qmail-smtpd
    else
      echo qmail-smtpd service not running
    fi
    if [ -d /var/lock/subsys ]; then
      touch /var/lock/subsys/qmail
    fi
    ;;
  stop)
    echo "Stopping qmail..."
    echo "  qmail-smtpd"
    svc -d /service/qmail-smtpd
    echo "  qmail-send"
    svc -d /service/qmail-send
    if [ -f /var/lock/subsys/qmail ]; then
      rm /var/lock/subsys/qmail
    fi
    ;;
  stat)
    svstat /service/qmail-send
    svstat /service/qmail-send/log
    svstat /service/qmail-smtpd
    svstat /service/qmail-smtpd/log
    qmail-qstat
    ;;
  doqueue|alrm|flush)
    echo "Sending ALRM signal to qmail-send."
    svc -a /service/qmail-send
    ;;
  queue)
    qmail-qstat
    qmail-qread
    ;;
  reload|hup)
    echo "Sending HUP signal to qmail-send."
    svc -h /service/qmail-send
    ;;
  pause)
    echo "Pausing qmail-send"
    svc -p /service/qmail-send
    echo "Pausing qmail-smtpd"
    svc -p /service/qmail-smtpd
    ;;
  cont)
    echo "Continuing qmail-send"
    svc -c /service/qmail-send
    echo "Continuing qmail-smtpd"
    svc -c /service/qmail-smtpd
    ;;
  restart)
    echo "Restarting qmail:"
    echo "* Stopping qmail-smtpd."
    svc -d /service/qmail-smtpd
    echo "* Sending qmail-send SIGTERM and restarting."
    svc -t /service/qmail-send
    echo "* Restarting qmail-smtpd."
    svc -u /service/qmail-smtpd
    ;;
  cdb)
    /home/vpopmail/bin/clearopensmtp
    echo "Ran /home/vpopmail/bin/clearopensmtp."
    ;;
  help)
    cat 
     

[ Reply to This | # ]