#!/bin/sh # # pdns Proxy DNS Daemon # # chkconfig: 345 14 89 # # description: Proxy DNS Daemon # # Source function library . /etc/rc.d/init.d/functions # Get network config . /etc/sysconfig/network # Default parameters STATUS="--status" DEBUG="--debug" VERBOSE="-v2" # Get service config - may override defaults [ -f /etc/sysconfig/pdnsd ] && . /etc/sysconfig/pdnsd # Check that networking is up. if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then msg_network_down Pdnsd exit 1 fi else exit 0 fi test -x /usr/sbin/pdnsd || exit 0 RETVAL=0 case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/pdns ]; then msg_starting Pdns daemon pdnsd --daemon -p /var/run/pdnsd.pid $STATUS $DEBUG $VERBOSE RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pdns else msg_already_running Pdns fi ;; stop) if [ -f /var/lock/subsys/pdns ]; then # Stop daemons. msg_stopping Pdns killproc pdnsd rm -f /var/lock/subsys/pdns >/dev/null 2>&1 else msg_not_running Pdns fi ;; restart) $0 stop $0 start exit $? ;; reload|force-reload) if [ -f /var/lock/subsys/pdns ]; then msg_reloading Pdns killproc pdnsd -HUP RETVAL=$? else msg_not_running Pdns >&2 exit 7 fi ;; status) status pdnsd exit $? ;; *) msg_usage "$0 {start|stop|restart|reload|force-reload|status}" exit 3 esac exit $RETVAL