]> git.pld-linux.org Git - packages/pdnsd.git/blame - pdnsd.init
- pdnsd is fucked up, here comes the horrible workaround.
[packages/pdnsd.git] / pdnsd.init
CommitLineData
f15d27a2 1#!/bin/sh
42292d0f 2#
f15d27a2 3# pdns Proxy DNS Daemon
42292d0f 4#
1d08e2b6 5# chkconfig: 345 14 89
42292d0f 6#
f15d27a2 7# description: Proxy DNS Daemon
42292d0f 8#
9
f15d27a2 10# Source function library
42292d0f 11. /etc/rc.d/init.d/functions
12
f15d27a2 13# Get network config
14. /etc/sysconfig/network
42292d0f 15
f15d27a2 16# Get service config - may override defaults
17[ -f /etc/sysconfig/pdnsd ] && . /etc/sysconfig/pdnsd
18
19# Check that networking is up.
20if is_no "${NETWORKING}"; then
21 msg_Network_Down Pdnsd
22 exit 1
23fi
24
25test -x /usr/sbin/pdnsd || exit 0
42292d0f 26
42292d0f 27case "$1" in
238cdec9 28 start)
f15d27a2 29 # Check if the service is already running?
30 if [ ! -f /var/lock/subsys/pdns ]; then
31 msg_starting Pdns
957967af 32 daemon pdnsd --daemon
f15d27a2 33 RETVAL=$?
34 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pdns
35 else
36 msg_Already_Running Pdns
37 exit 1
38 fi
79ef3bdc 39 ;;
42292d0f 40 stop)
79ef3bdc
TP
41 # Stop daemons.
42 # show "Stopping %s service" pdns
007fff28 43 if [ -f /var/lock/subsys/pdns ]; then
79ef3bdc
TP
44
45# 1. killproc causes pdnsd not to save cache file on exit.
46# The only signals not doing this are 4, 6, 8 and 11.
47# These signals terminate this script anyway.
48# 2. killproc tries to kill all found processes. In this
49# case they are connected and die together, so doing
50# this will print errors on screen.
51
52# msg_stopping Pdns
53# killproc pdnsd
54
55 echo "Stopping Pdns service"
56
f15d27a2 57 rm -f /var/lock/subsys/pdns >/dev/null 2>&1
79ef3bdc
TP
58
59 killall -FPE pdnsd
60
f15d27a2 61 else
62 msg_Not_Running Pdns
63 exit 1
64 fi
79ef3bdc 65 ;;
f15d27a2 66 restart)
79ef3bdc
TP
67 echo "Due to a pdnsd bug you must start it manually."
68 $0 stop
69 ;;
f15d27a2 70 reload)
71 if [ -f /var/lock/subsys/pdns ]; then
72 msg_show Pdns
73 msg_reload
74 busy
75 killproc pdnsd -HUP
76 deltext
77 ok
78 else
79 msg_Not_Running Pdns
80 exit 1
81 fi
42292d0f 82 ;;
f15d27a2 83 force-reload)
79ef3bdc 84 # if program allows reloading without stopping
f15d27a2 85 $0 reload
86 exit $?
87
88 # or if it doesn't
79ef3bdc 89 $0 restart
f15d27a2 90 exit $?
42292d0f 91 ;;
f15d27a2 92 status)
93 status pdnsd
94 exit $?
79ef3bdc 95 ;;
42292d0f 96 *)
79ef3bdc 97 # show "Usage: %s {start|stop|status|restart|reload|force-reload}" $0
f15d27a2 98 msg_Usage "$0 {start|stop|status|restart|reload|force-reload}"
79ef3bdc 99 exit 1
42292d0f 100esac
101
102exit $RETVAL
This page took 0.29878 seconds and 4 git commands to generate.