#!/sbin/sh ############################################# # SLOW.INIT # A script that starts, stops, and # restarts the milter. # # This script may be installed in /etc/init.d # under Solaris and the like. Or used as # an /etc/rc-style startup script. ############################################# export MILTER MILTERDIR MILTERARGS MILTERSLEEP MILTERSEMAPHORE MILTER=slowmilt MILTERDIR=/etc/mail/milter/slow MILTERARGS= MILTERSLEEP=5 MILTERRUN=slow.run MILTERSEMAPHORE=slow.semaphore # # Whom is the milter running as? # NOTE that this MUST match the user specified by the RunAsUser # configuration file item. # MILTERWHO=slow # # The command to kill the milter. Set to be right for your OS. # MILTERKILL="/usr/bin/pkill -x -u ${MILTERWHO} ${MILTER}" #MILTERKILL="/usr/bin/killall ${MILTER}" case "$1" in 'start') if [ -f ${MILTERDIR}/${MILTER} -a -d ${MILTERDIR} ]; then ${MILTERDIR}/${MILTER} -f touch ${MILTERDIR}/${MILTERSEMAPHORE} exec ${MILTERDIR}/${MILTERRUN} & echo ${MILTER} started else echo Error: ${MILTER} or ${MILTERDIR} missing. fi ;; 'stop') rm ${MILTERDIR}/${MILTERSEMAPHORE} ${MILTERKILL} echo ${MILTER} stopped ;; 'restart') $0 stop echo Waiting for slowmilt to settle. sleep ${MILTERSLEEP} sleep ${MILTERSLEEP} $0 start ;; *) echo "Usage: $0 { start | stop | restart }" exit 1 ;; esac exit 0