Mercurial > dnsbl
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 |
rev | line source |
---|---|
0 | 1 #!/bin/sh |
2 # | |
3 # dnsbl This script controls the dnsbl milter daemon. | |
4 # | |
5 # | |
6 # chkconfig: 2345 79 31 | |
7 # description: dnsbl is an interface between MTA and the various dns blocking lists | |
8 # processname: dnsbl | |
9 # pidfile: /var/run/dnsbl.pid | |
10 # Source function library. | |
11 # | |
12 . /etc/rc.d/init.d/functions | |
13 | |
14 # Source networking configuration. | |
15 . /etc/sysconfig/network | |
16 | |
17 RETVAL=0 | |
18 # See how we were called. | |
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 | 21 # Start daemons. |
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 | 25 #su -l dnsbl -s /bin/sh -c "/usr/sbin/dnsbl -d -p local:/var/run/dnsbl.sock " |
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 | 44 ;; |
41
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
45 stop) |
0 | 46 # Stop daemons. |
47 echo -n "Shutting down dnsbl-milter: " | |
48 killproc dnsbl | |
49 RETVAL=$? | |
50 echo | |
51 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dnsbl | |
52 ;; | |
41
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
53 restart|reload) |
0 | 54 $0 stop |
55 $0 start | |
56 RETVAL=$? | |
57 ;; | |
41
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
58 status) |
0 | 59 status dnsbl |
60 RETVAL=$? | |
61 ;; | |
41
d95af8129dfa
updates for 3.2, changing file layout, add queueid to messages
carl
parents:
16
diff
changeset
|
62 *) |
0 | 63 echo "Usage: dnsbl {start|stop|restart|status}" |
64 exit 1 | |
65 esac | |
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$ |