Group :: System/Servers
RPM: nsd
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
#!/bin/sh
#
# nsd Starts the NSD Name Server Daemon
#
# chkconfig: - 13 87
# description: \
# NSD is a complete implementation of an authoritative DNS name server.
# processname: nsd
# config: /etc/nsd/nsd.conf
### BEGIN INIT INFO
# Provides: nsd
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $network $syslog
# Default-Stop: 0 1 6
# Short-Description: start|stop|status|restart|try-restart|reload|force-reload DNS server
# Description: control NSD implementation of DNS server
### END INIT INFO
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
SourceIfNotEmpty /etc/sysconfig/network
LOCKFILE=/var/lock/subsys/nsd
RETVAL=0
start()
{
is_yes "$NETWORKING" || return 0
/usr/sbin/nsdc rebuild >/dev/null 2>&1
start_daemon --lockfile "$LOCKFILE" --expect-user _nsd -- nsd
RETVAL=$?
return $RETVAL
}
stop()
{
stop_daemon --lockfile "$LOCKFILE" --expect-user _nsd -- nsd
RETVAL=$?
return $RETVAL
}
restart()
{
stop
start
}
reload()
{
msg_reloading nsd
stop_daemon --expect-user _nsd -HUP -- nsd
RETVAL=$?
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status --lockfile "$LOCKFILE" --expect-user _nsd nsd
RETVAL=$?
;;
reload)
reload
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
condreload)
if [ -e "$LOCKFILE" ]; then
reload
fi
;;
*)
msg_usage "${0##*/} {start|stop|restart|reload|status|condstop|condrestart}"
RETVAL=1
esac
exit $RETVAL