]> git.pld-linux.org Git - packages/spamassassin.git/blame_incremental - spamassassin-spamd.init
- updated to 3.2.2
[packages/spamassassin.git] / spamassassin-spamd.init
... / ...
CommitLineData
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
19SPAMD_OPTS="-d -c"
20# Source configureation.
21if [ -f /etc/sysconfig/spamd ] ; then
22 . /etc/sysconfig/spamd
23fi
24
25# Check that networking is up.
26if is_no "${NETWORKING}"; then
27 msg_network_down SpamAssassin
28 exit 1
29fi
30
31start() {
32 # Start daemon.
33 if [ ! -f /var/lock/subsys/spamd ]; then
34 msg_starting SpamAssassin
35 daemon spamd $SPAMD_OPTS
36 RETVAL=$?
37 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/spamd
38 else
39 msg_already_running SpamAssassin
40 fi
41}
42
43stop() {
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
55# See how we were called.
56case "$1" in
57 start)
58 start
59 ;;
60 stop)
61 stop
62 ;;
63 restart)
64 stop
65 start
66 ;;
67 status)
68 status spamd
69 ;;
70 *)
71 msg_usage "$0 {start|stop|restart|status}"
72 exit 1
73esac
74
75exit $RETVAL
This page took 0.056231 seconds and 4 git commands to generate.