annotate dnsbl.rc @ 210:cf2ecf5bacc9

Added tag stable-6-0-17 for changeset 0fc1899391b6
author Carl Byington <carl@five-ten-sg.com>
date Wed, 05 Mar 2008 18:24:36 -0800
parents 7161d8451fcf
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
166
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
1 #!/bin/sh
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
2 #
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
3 # dnsbl This script controls the dnsbl milter daemon.
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
4 #
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
5 #
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
6 # chkconfig: 2345 79 31
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
7 # description: dnsbl is an interface between MTA and the various dns blocking lists
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
8 # processname: dnsbl
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
9 # pidfile: /var/run/dnsbl.pid
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
10 # Source function library.
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
11 #
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
12 . /etc/rc.d/init.d/functions
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
13
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
14 # Source networking configuration.
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
15 . /etc/sysconfig/network
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
16
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
17 RETVAL=0
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
18 # See how we were called.
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
19 case "$1" in
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
20 start)
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
21 # Start daemons.
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
22 echo -n "Starting dnsbl-milter: "
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
23 if [ ! -f /var/lock/subsys/dnsbl ]; then
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
24 cd SYSCONFDIR/dnsbl # conf file is here
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
25 SBINDIR/dnsbl -d 10 -r /var/run/dnsbl/dnsbl.resolver.sock -p local:/var/run/dnsbl/dnsbl.sock
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
26 RETVAL=$?
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
27 pid=`pidof -s SBINDIR/dnsbl`
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
28 if [ $pid ]
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
29 then
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
30 success "Starting dnsbl milter:"
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
31 touch /var/lock/subsys/dnsbl
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
32 echo
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
33 else
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
34 failure "Starting dnsbl milter:"
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
35 echo
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
36 fi
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
37 else
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
38 echo -n "already running! "
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
39 failure "dnsbl milter already running!"
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
40 echo
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
41 fi
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
42
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
43 ;;
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
44 stop)
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
45 # Stop daemons.
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
46 echo -n "Shutting down dnsbl-milter: "
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
47 killproc dnsbl
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
48 RETVAL=$?
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
49 echo
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
50 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dnsbl
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
51 ;;
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
52 restart|reload)
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
53 $0 stop
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
54 $0 start
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
55 RETVAL=$?
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
56 ;;
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
57 status)
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
58 status dnsbl
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
59 RETVAL=$?
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
60 ;;
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
61 *)
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
62 echo "Usage: dnsbl {start|stop|restart|status}"
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
63 exit 1
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
64 esac
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
65 exit $RETVAL
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
66
7161d8451fcf fix unitialized variable
carl
parents:
diff changeset
67 # $Id$