]> git.pld-linux.org Git - packages/pdnsd.git/blame - pdnsd.init
- remove remnants from template.init
[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
4a176474 16# Default parameters
17STATUS="--status"
18DEBUG="--debug"
19VERBOSE="-v2"
20
f15d27a2 21# Get service config - may override defaults
22[ -f /etc/sysconfig/pdnsd ] && . /etc/sysconfig/pdnsd
23
24# Check that networking is up.
2187c474 25if is_yes "${NETWORKING}"; then
7e2eb69a 26 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
2187c474 27 msg_network_down Pdnsd
28 exit 1
29 fi
30else
31 exit 0
f15d27a2 32fi
33
34test -x /usr/sbin/pdnsd || exit 0
42292d0f 35
70912e68 36RETVAL=0
42292d0f 37case "$1" in
238cdec9 38 start)
f15d27a2 39 # Check if the service is already running?
40 if [ ! -f /var/lock/subsys/pdns ]; then
41 msg_starting Pdns
78d51cbd 42 daemon pdnsd --daemon -p /var/run/pdnsd.pid $STATUS $DEBUG $VERBOSE
f15d27a2 43 RETVAL=$?
44 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pdns
45 else
2187c474 46 msg_already_running Pdns
f15d27a2 47 fi
79ef3bdc 48 ;;
42292d0f 49 stop)
007fff28 50 if [ -f /var/lock/subsys/pdns ]; then
2187c474 51 # Stop daemons.
8d303ff6
TP
52 msg_stopping Pdns
53 killproc pdnsd
f15d27a2 54 rm -f /var/lock/subsys/pdns >/dev/null 2>&1
55 else
2187c474 56 msg_not_running Pdns
8d303ff6 57 fi
79ef3bdc 58 ;;
f15d27a2 59 restart)
79ef3bdc 60 $0 stop
8d303ff6 61 $0 start
70912e68 62 exit $?
79ef3bdc 63 ;;
70912e68 64 reload|force-reload)
f15d27a2 65 if [ -f /var/lock/subsys/pdns ]; then
2187c474 66 msg_reloading Pdns
f15d27a2 67 killproc pdnsd -HUP
70912e68 68 RETVAL=$?
f15d27a2 69 else
70912e68 70 msg_not_running Pdns >&2
71 exit 7
f15d27a2 72 fi
42292d0f 73 ;;
f15d27a2 74 status)
75 status pdnsd
76 exit $?
79ef3bdc 77 ;;
42292d0f 78 *)
2187c474 79 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
70912e68 80 exit 3
42292d0f 81esac
82
83exit $RETVAL
This page took 0.100562 seconds and 4 git commands to generate.