3 # spamassassin This script starts and stops the spamd daemon
5 # chkconfig: 2345 80 30
7 # description: spamd is a daemon process which uses SpamAssassin to check \
8 # email messages for SPAM. It is normally called by spamc \
11 # pidfile: /var/run/spamassassin.pid
13 # Source function library.
14 . /etc/rc.d/init.d/functions
16 # Source networking configuration.
17 . /etc/sysconfig/network
20 # Source configureation.
21 if [ -f /etc/sysconfig/spamd ] ; then
22 . /etc/sysconfig/spamd
25 # Check that networking is up.
26 if is_no "${NETWORKING}"; then
27 msg_network_down "SpamAssassin"
33 if [ -f /var/lock/subsys/spamd ]; then
34 msg_already_running "SpamAssassin"
38 # Check if database is installed.
39 if [ "$(find /var/lib/spamassassin/ -name '*.cf' | head -n1 | wc -l)" -eq 0 ]; then
40 show 'Spamassassin database not found. Run sa-update first.'; fail
44 msg_starting "SpamAssassin"
45 daemon /usr/bin/spamd $SPAMD_OPTS
47 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/spamd
52 if [ ! -f /var/lock/subsys/spamd ]; then
53 msg_not_running "SpamAssassin"
57 msg_stopping "SpamAssassin"
58 killproc --pidfile spamassassin.pid spamd
60 rm -f /var/lock/subsys/spamd
64 if [ ! -f /var/lock/subsys/spamd ]; then
65 msg_not_running "SpamAssassin"
74 # See how we were called.
96 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"