#!/bin/sh # # spamassassin This script starts and stops the spamd daemon # # chkconfig: - 78 30 # processname: dspam # description: dspam # Source function library. . /etc/rc.d/init.d/functions prog="dspam" # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 # Set default spamd configuration. DSPAMOPTIONS="" DSPAM_PID=/var/run/dspam.pid # Source spamd configuration. if [ -f /etc/sysconfig/dspam ] ; then . /etc/sysconfig/dspam fi [ -f /usr/bin/dspam -o -f /usr/local/bin/dspam ] || exit 0 PATH=$PATH:/usr/bin:/usr/local/bin # By default it's all good RETVAL=0 # See how we were called. case "$1" in start) # Start daemon. echo -n $"Starting $prog: " # daemon $NICELEVEL dspam $DSPAMOPTIONS --daemon # daemon $NICELEVEL dspam $DSPAMOPTIONS --daemon & dspam $DSPAMOPTIONS --daemon & RETVAL=$? echo if [ $RETVAL = 0 ]; then touch /var/lock/subsys/dspam fi ;; stop) # Stop daemons. echo -n $"Stopping $prog: " killproc dspam RETVAL=$? echo if [ $RETVAL = 0 ]; then rm -f /var/lock/subsys/dspam rm -f $DSPAM_PID fi ;; restart) $0 stop sleep 3 $0 start ;; condrestart) [ -e /var/lock/subsys/dspam ] && $0 restart ;; status) status spamd RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart|status|condrestart}" RETVAL=1 ;; esac exit $RETVAL