]> git.pld-linux.org Git - packages/spamassassin.git/blob - spamassassin-spamd.init
- fix processname:
[packages/spamassassin.git] / spamassassin-spamd.init
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.
10 # processname: spamd
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
19 # Source configureation.
20 if [ -f /etc/sysconfig/spamassassin ] ; then
21         . /etc/sysconfig/spamassassin
22 fi
23
24 # Check that networking is up.
25 if is_no "${NETWORKING}"; then
26         msg_network_down SpamAssassin
27         exit 1
28 fi
29
30 # See how we were called.
31 case "$1" in
32   start)
33         # Start daemon.
34         if [ ! -f /var/lock/subsys/spamd ]; then
35                 msg_starting SpamAssassin
36                 daemon spamd $SPAMD_OPTS
37                 RETVAL=$?
38                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/spamd
39         else
40                 msg_already_running SpamAssassin
41         fi
42         ;;
43   stop)
44         # Stop daemons.
45         if [ -f /var/lock/subsys/spamd ]; then
46                 msg_stopping SpamAssassin
47                 killproc spamd
48                 RETVAL=$?
49                 rm -f /var/lock/subsys/spamd
50         else
51                 msg_not_running SpamAssassin
52         fi
53         ;;
54   restart)
55         $0 stop
56         $0 start
57         ;;
58   status)
59         status spamd
60         ;;
61   *)
62         msg_usage "$0 {start|stop|restart|status}"
63         exit 1
64 esac
65
66 exit $RETVAL
This page took 0.031549 seconds and 4 git commands to generate.