# email messages for SPAM. It is normally called by spamc \
# from a MDA.
# processname: spamd
-# pidfile: /var/run/spamassassin.pid
+# pidfile: /var/run/spamd.pid
# Source function library.
. /etc/rc.d/init.d/functions
fi
# Check if database is installed.
- if [ "$(find /var/lib/spamassassin/ -name '*.cf' | wc -l)" == 0 ]; then
+ if [ "$(find /var/lib/spamassassin/ -name '*.cf' | head -n1 | wc -l)" -eq 0 ]; then
show 'Spamassassin database not found. Run sa-update first.'; fail
return 1
fi
msg_starting "SpamAssassin"
- daemon /usr/bin/spamd $SPAMD_OPTS
+ daemon /usr/bin/spamd -r /var/run/spamd.pid $SPAMD_OPTS
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/spamd
}
fi
msg_stopping "SpamAssassin"
- killproc spamd
+ killproc --pidfile spamd.pid spamd
RETVAL=$?
rm -f /var/lock/subsys/spamd
}
# See how we were called.
case "$1" in
start)
- start
+ start
;;
stop)
- stop
+ stop
;;
restart)
stop
condrestart 7
;;
status)
- status spamd
+ status --pidfile spamd.pid spamd
;;
*)
msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"