annotate dnsbl.rc @ 42:afcf403709ef

updates for 3.2, try to drop root privileges
author carl
date Mon, 05 Jul 2004 13:09:44 -0700
parents d95af8129dfa
children 6b79046b18c2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
96a9758165cd Initial revision
carl
parents:
diff changeset
1 #!/bin/sh
96a9758165cd Initial revision
carl
parents:
diff changeset
2 #
96a9758165cd Initial revision
carl
parents:
diff changeset
3 # dnsbl This script controls the dnsbl milter daemon.
96a9758165cd Initial revision
carl
parents:
diff changeset
4 #
96a9758165cd Initial revision
carl
parents:
diff changeset
5 #
96a9758165cd Initial revision
carl
parents:
diff changeset
6 # chkconfig: 2345 79 31
96a9758165cd Initial revision
carl
parents:
diff changeset
7 # description: dnsbl is an interface between MTA and the various dns blocking lists
96a9758165cd Initial revision
carl
parents:
diff changeset
8 # processname: dnsbl
96a9758165cd Initial revision
carl
parents:
diff changeset
9 # pidfile: /var/run/dnsbl.pid
96a9758165cd Initial revision
carl
parents:
diff changeset
10 # Source function library.
96a9758165cd Initial revision
carl
parents:
diff changeset
11 #
96a9758165cd Initial revision
carl
parents:
diff changeset
12 . /etc/rc.d/init.d/functions
96a9758165cd Initial revision
carl
parents:
diff changeset
13
96a9758165cd Initial revision
carl
parents:
diff changeset
14 # Source networking configuration.
96a9758165cd Initial revision
carl
parents:
diff changeset
15 . /etc/sysconfig/network
96a9758165cd Initial revision
carl
parents:
diff changeset
16
96a9758165cd Initial revision
carl
parents:
diff changeset
17 RETVAL=0
96a9758165cd Initial revision
carl
parents:
diff changeset
18 # See how we were called.
96a9758165cd Initial revision
carl
parents:
diff changeset
19 case "$1" in
41
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
20 start)
0
96a9758165cd Initial revision
carl
parents:
diff changeset
21 # Start daemons.
96a9758165cd Initial revision
carl
parents:
diff changeset
22 echo -n "Starting dnsbl-milter: "
41
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
23 if [ ! -f /var/lock/subsys/dnsbl ]; then
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
24 cd /etc/dnsbl # conf file is here
42
afcf403709ef updates for 3.2, try to drop root privileges
carl
parents: 41
diff changeset
25 #su -l dnsbl -s /bin/sh -c "/usr/sbin/dnsbl -d -p local:/var/run/dnsbl.sock "
afcf403709ef updates for 3.2, try to drop root privileges
carl
parents: 41
diff changeset
26 /usr/sbin/dnsbl -d -p local:/var/run/dnsbl.sock
41
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
27 RETVAL=$?
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
28 pid=`pidof -s /usr/sbin/dnsbl`
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
29 if [ $pid ]
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
30 then
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
31 success "Starting dnsbl milter:"
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
32 touch /var/lock/subsys/dnsbl
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
33 echo
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
34 else
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
35 failure "Starting dnsbl milter:"
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
36 echo
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
37 fi
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
38 else
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
39 echo -n "already running! "
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
40 failure "dnsbl milter already running!"
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
41 echo
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
42 fi
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
43
0
96a9758165cd Initial revision
carl
parents:
diff changeset
44 ;;
41
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
45 stop)
0
96a9758165cd Initial revision
carl
parents:
diff changeset
46 # Stop daemons.
96a9758165cd Initial revision
carl
parents:
diff changeset
47 echo -n "Shutting down dnsbl-milter: "
96a9758165cd Initial revision
carl
parents:
diff changeset
48 killproc dnsbl
96a9758165cd Initial revision
carl
parents:
diff changeset
49 RETVAL=$?
96a9758165cd Initial revision
carl
parents:
diff changeset
50 echo
96a9758165cd Initial revision
carl
parents:
diff changeset
51 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dnsbl
96a9758165cd Initial revision
carl
parents:
diff changeset
52 ;;
41
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
53 restart|reload)
0
96a9758165cd Initial revision
carl
parents:
diff changeset
54 $0 stop
96a9758165cd Initial revision
carl
parents:
diff changeset
55 $0 start
96a9758165cd Initial revision
carl
parents:
diff changeset
56 RETVAL=$?
96a9758165cd Initial revision
carl
parents:
diff changeset
57 ;;
41
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
58 status)
0
96a9758165cd Initial revision
carl
parents:
diff changeset
59 status dnsbl
96a9758165cd Initial revision
carl
parents:
diff changeset
60 RETVAL=$?
96a9758165cd Initial revision
carl
parents:
diff changeset
61 ;;
41
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
62 *)
0
96a9758165cd Initial revision
carl
parents:
diff changeset
63 echo "Usage: dnsbl {start|stop|restart|status}"
96a9758165cd Initial revision
carl
parents:
diff changeset
64 exit 1
96a9758165cd Initial revision
carl
parents:
diff changeset
65 esac
96a9758165cd Initial revision
carl
parents:
diff changeset
66 exit $RETVAL
41
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
67
d95af8129dfa updates for 3.2, changing file layout, add queueid to messages
carl
parents: 16
diff changeset
68 # $Id$