#!/bin/sh # # spamassassin This script starts and stops the spamd daemon # # chkconfig: 2345 80 30 # # description: spamd is a daemon process which uses SpamAssassin to check \ # email messages for SPAM. It is normally called by spamc \ # from a MDA. # processname: spamd # pidfile: /var/run/spamassassin.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network SPAMD_OPTS="-d -c" # Source configureation. if [ -f /etc/sysconfig/spamd ] ; then . /etc/sysconfig/spamd fi # Check that networking is up. if is_no "${NETWORKING}"; then msg_network_down SpamAssassin exit 1 fi start() { # Start daemon. if [ ! -f /var/lock/subsys/spamd ]; then msg_starting SpamAssassin daemon spamd $SPAMD_OPTS RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/spamd else msg_already_running SpamAssassin fi } stop() { # Stop daemons. if [ -f /var/lock/subsys/spamd ]; then msg_stopping SpamAssassin killproc spamd RETVAL=$? rm -f /var/lock/subsys/spamd else msg_not_running SpamAssassin fi } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) status spamd ;; *) msg_usage "$0 {start|stop|restart|status}" exit 1 esac exit $RETVAL