qmailのスタートアップスクリプト
qmailのスタートアップスクリプトを書いてみた。
if [ -f /var/qmail/bin/qmail-scanner-queue.pl ] ; then QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl" export QMAILQUEUE ulimit -v 32768 fi
とかして、qmail-scannerにも対応。
#!/bin/sh # # Startup script for qmail # # chkconfig: - 85 15 # description: the qmail MTA # # # qmail: /var/qmail PATH=/var/qmail/bin:/usr/local/bin:/bin:/usr/bin QMAILDUID=`id -u qmaild` NOFILESGID=`id -g qmaild` if [ -f /var/qmail/bin/qmail-scanner-queue.pl ] ; then QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl" export QMAILQUEUE ulimit -v 32768 fi [ -f /var/qmail/rc ] || exit 0 case "$1" in start) # Start daemons. echo "Starting qmail." csh -cf '/var/qmail/rc &' /usr/local/bin/tcpserver -R -H -x /etc/tcp.smtp.cdb -u $QMAILDUID -g $NOFILESGID 0 smtp \ /usr/local/bin/rblsmtpd /var/qmail/bin/qmail-smtpd & echo touch /var/lock/qmail ;; stop) # Stop daemons. echo "Shutting down qmail." PID=`/bin/ps -aefw | grep qmail | awk '{print $2}'` if [ ! -z "$PID" ] ; then /bin/kill ${PID} 1> /dev/null 2>&1 fi echo rm -f /var/lock/qmail ;; *) echo "Usage: S99qmail {start|stop}" exit 1 esac exit 0