Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/sh
2
#
3
# spamassassin This script starts and stops the spamd daemon
4
#
5
# chkconfig: - 78 30
6
# processname: spamd
7
# description: spamd is a daemon process which uses SpamAssassin to check \
8
#              email messages for SPAM.  It is normally called by spamc \
9
#	       from a MDA.
10
 
11
# Source function library.
12
. /etc/rc.d/init.d/functions
13
 
14
prog="spamd"
15
 
16
# Source networking configuration.
17
. /etc/sysconfig/network
18
 
19
# Check that networking is up.
20
[ ${NETWORKING} = "no" ] && exit 0
21
 
22
# Set default spamd configuration.
23
SPAMDOPTIONS="-d -c -m5 -H"
24
SPAMD_PID=/var/run/spamd.pid
25
 
26
# Source spamd configuration.
27
if [ -f /etc/sysconfig/spamassassin ] ; then
28
	. /etc/sysconfig/spamassassin
29
fi
30
 
31
[ -f /usr/bin/spamd -o -f /usr/local/bin/spamd ] || exit 0
32
PATH=$PATH:/usr/bin:/usr/local/bin
33
 
34
# By default it's all good
35
RETVAL=0
36
 
37
# See how we were called.
38
case "$1" in
39
  start)
40
	# tell portreserve to release the port
41
	[ -x /sbin/portrelease ] && /sbin/portrelease spamd &>/dev/null || :
42
	# Start daemon.
43
	echo -n $"Starting $prog: "
44
	daemon $NICELEVEL spamd $SPAMDOPTIONS -r $SPAMD_PID
45
	RETVAL=$?
46
        echo
47
	if [ $RETVAL = 0 ]; then
48
		touch /var/lock/subsys/spamd
49
	fi
50
        ;;
51
  stop)
52
        # Stop daemons.
53
        echo -n $"Stopping $prog: "
54
        killproc spamd
55
        RETVAL=$?
56
        echo
57
	if [ $RETVAL = 0 ]; then
58
		rm -f /var/lock/subsys/spamd
59
		rm -f $SPAMD_PID
60
	fi
61
        ;;
62
  restart)
63
        $0 stop
64
	sleep 3
65
        $0 start
66
        ;;
67
  condrestart)
68
       [ -e /var/lock/subsys/spamd ] && $0 restart
69
       ;;
70
  status)
71
	status spamd
72
	RETVAL=$?
73
	;;
74
  *)
75
	echo "Usage: $0 {start|stop|restart|status|condrestart}"
76
	RETVAL=1
77
	;;
78
esac
79
 
80
exit $RETVAL