#!/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 ]; then msg_network_down Pdnsd exit 1 fi else exit 0 fi test -x /usr/sbin/pdnsd || exit 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 $STATUS $DEBUG $VERBOSE RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pdns else msg_already_running Pdns exit 1 fi ;; stop) if [ -f /var/lock/subsys/pdns ]; then # Stop daemons. # show "Stopping %s service" pdns msg_stopping Pdns killproc pdnsd rm -f /var/lock/subsys/pdns >/dev/null 2>&1 else msg_not_running Pdns exit 1 fi ;; restart) $0 stop $0 start ;; reload) if [ -f /var/lock/subsys/pdns ]; then msg_reloading Pdns killproc pdnsd -HUP else msg_not_running Pdns exit 1 fi ;; force-reload) $0 reload exit $? ;; status) status pdnsd exit $? ;; *) # show "Usage: %s {start|stop|restart|reload|force-reload|status}" msg_usage "$0 {start|stop|restart|reload|force-reload|status}" exit 1 esac exit $RETVAL