]> git.pld-linux.org Git - packages/pdnsd.git/blame - pdnsd.init
- up
[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
4a176474 42 daemon pdnsd --daemon $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.
52 # show "Stopping %s service" pdns
8d303ff6
TP
53 msg_stopping Pdns
54 killproc pdnsd
f15d27a2 55 rm -f /var/lock/subsys/pdns >/dev/null 2>&1
56 else
2187c474 57 msg_not_running Pdns
8d303ff6 58 fi
79ef3bdc 59 ;;
f15d27a2 60 restart)
79ef3bdc 61 $0 stop
8d303ff6 62 $0 start
70912e68 63 exit $?
79ef3bdc 64 ;;
70912e68 65 reload|force-reload)
f15d27a2 66 if [ -f /var/lock/subsys/pdns ]; then
2187c474 67 msg_reloading Pdns
f15d27a2 68 killproc pdnsd -HUP
70912e68 69 RETVAL=$?
f15d27a2 70 else
70912e68 71 msg_not_running Pdns >&2
72 exit 7
f15d27a2 73 fi
42292d0f 74 ;;
f15d27a2 75 status)
76 status pdnsd
77 exit $?
79ef3bdc 78 ;;
42292d0f 79 *)
2187c474 80 # show "Usage: %s {start|stop|restart|reload|force-reload|status}"
81 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
70912e68 82 exit 3
42292d0f 83esac
84
85exit $RETVAL
This page took 0.083806 seconds and 4 git commands to generate.