Sophie

Sophie

distrib > Mageia > 1 > x86_64 > media > core-release-src > by-pkgid > 4d6cac74ba040b17c98eaff58a581527 > files > 9

spamassassin-3.3.2-0.0.r2260312.1.mga1.src.rpm

#!/bin/sh
#
# spamd This script starts and stops the spamd daemon
#
# chkconfig: - 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.

### BEGIN INIT INFO
# Provides: spamd
# Required-Start: $network
# Required-Stop: $network
# Should-Start: $named mysqld postgresql ldap
# Should-Stop: $named mysqld postgresql ldap
# Default-Start: 2 3 4 5
# Short-Description: Starts the spamd daemon
# Description: spamd is a daemon process which uses SpamAssassin to check
#              email messages for SPAM.  It is normally called by spamc
#	       from a MDA.
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# Source spamd configuration.
if [ -f /etc/sysconfig/spamd ] ; then
        . /etc/sysconfig/spamd
else
        SPAMDOPTIONS="-d -c -a -m5 -H --syslog=/var/log/spamassassin/spamd.log"
fi

[ -f /usr/bin/spamd -o -f /usr/local/bin/spamd ] || exit 0
PATH=$PATH:/usr/bin:/usr/local/bin

RETVAL=0

# See how we were called.
case "$1" in
  start)
	# Start daemon.
	echo -n "Starting spamd: "
	daemon spamd $SPAMDOPTIONS
	RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch /var/lock/subsys/spamd
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down spamd: "
        killproc spamd
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && rm -f /var/lock/subsys/spamd
        ;;
  restart|reload)
        $0 stop
        $0 start
        ;;
  condrestart)
	if [ -f /var/lock/subsys/spamd ]; then
	    $0 stop
	    $0 start
	fi
	;;
  status)
	status spamd
	;;
  *)
	echo "Usage: $0 {start|stop|restart|status|condrestart}"
	RETVAL=1
	;;
esac

exit $RETVAL