]> git.pld-linux.org Git - packages/spamassassin.git/blame - spamassassin-spamd.init
- rel 1
[packages/spamassassin.git] / spamassassin-spamd.init
CommitLineData
0af639ae
JR
1#!/bin/sh
2#
3# spamassassin This script starts and stops the spamd daemon
4#
5# chkconfig: 2345 80 30
6#
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.
1d4bbe26 10# processname: spamd
0af639ae
JR
11# pidfile: /var/run/spamassassin.pid
12
13# Source function library.
14. /etc/rc.d/init.d/functions
15
16# Source networking configuration.
17. /etc/sysconfig/network
18
8644bd81 19SPAMD_OPTS="-d -c"
0af639ae 20# Source configureation.
8644bd81
ER
21if [ -f /etc/sysconfig/spamd ] ; then
22 . /etc/sysconfig/spamd
0af639ae
JR
23fi
24
25# Check that networking is up.
26if is_no "${NETWORKING}"; then
55613dff 27 msg_network_down SpamAssassin
0af639ae
JR
28 exit 1
29fi
30
31# See how we were called.
32case "$1" in
33 start)
34 # Start daemon.
35 if [ ! -f /var/lock/subsys/spamd ]; then
36 msg_starting SpamAssassin
37 daemon spamd $SPAMD_OPTS
38 RETVAL=$?
39 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/spamd
40 else
55613dff 41 msg_already_running SpamAssassin
0af639ae
JR
42 fi
43 ;;
44 stop)
45 # Stop daemons.
46 if [ -f /var/lock/subsys/spamd ]; then
47 msg_stopping SpamAssassin
48 killproc spamd
49 RETVAL=$?
50 rm -f /var/lock/subsys/spamd
51 else
55613dff 52 msg_not_running SpamAssassin
0af639ae
JR
53 fi
54 ;;
55 restart)
56 $0 stop
57 $0 start
58 ;;
59 status)
60 status spamd
61 ;;
62 *)
55613dff 63 msg_usage "$0 {start|stop|restart|status}"
0af639ae
JR
64 exit 1
65esac
66
67exit $RETVAL
This page took 0.104868 seconds and 4 git commands to generate.