File pdnsd of Package pdnsd

#! /bin/sh
# Copyright (c) 1995-1998 SuSE GmbH Nuernberg, Germany.
#
# $Id: pdnsd.in,v 1.5 2001/10/14 16:11:02 tmm Exp $
#
# Modified 2000 from SuSE Linux 6.3 /sbin/init.d/skeleton by Thomas Moestl
#
# /sbin/init.d/pdnsd
#
#   and symbolic its link
#
# /sbin/rc?/pdnsd
#
### BEGIN INIT INFO
# Provides:          pdnsd
# Required-Start:    $network $remote_fs $syslog
# Should-Start:      $network $remote_fs $syslog
# Required-Stop:     $syslog $remote_fs
# Should-Stop:       ypbind smtp
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: pdnsd
# Description:       pdnsd
### END INIT INFO

. /etc/rc.status
rc_reset

# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}

# Force execution if not called by a runlevel directory.
test $link = $base && START_PDNSD=yes
test "$START_PDNSD" = yes || exit 0

# The echo return value for success (defined in /etc/rc.config).
return=$rc_done
case "$1" in
    start)
	echo -n "Starting pdnsd"
	## Start daemon with startproc(8). If this fails
	## the echo return value is set appropriate.

	startproc /usr/sbin/pdnsd -d || return=$rc_failed
	rc_status -v
	
	echo -e "$return"
	;;
    stop)
	echo -n "Shutting down pdnsd"
	## Stop daemon with killproc(8) and if this fails
	## set echo the echo return value.

	killproc -TERM /usr/sbin/pdnsd || return=$rc_failed

	echo -e "$return"
	rc_status -v
	;;
    restart)
	## If first returns OK call the second, if first or
	## second command fails, set echo return value.
	$0 stop  &&  $0 start  ||  return=$rc_failed
	rc_status -v
	;;
    reload)
	$0 stop  &&  $0 start  ||  return=$rc_failed
	rc_status -v
	;;
    status)
	echo -n "Checking for pdnsd: "
	## Check status with checkproc(8), if process is running
	## checkproc will return with exit status 0.

	checkproc /usr/sbin/pdnsd && echo OK || echo No process
	rc_status -v
	;;
    *)
	echo "Usage: $0 {start|stop|status|restart|reload}"
	exit 1
	;;
esac

# Inform the caller not only verbosely and set an exit status.
test "$return" = "$rc_done" || exit 1
exit 0

openSUSE Build Service is sponsored by