rpms/nsd/devel nsd.init,1.8,1.9

Paul Wouters pwouters at fedoraproject.org
Mon Nov 10 04:52:24 UTC 2008


Author: pwouters

Update of /cvs/extras/rpms/nsd/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25544

Modified Files:
	nsd.init 
Log Message:
updated nsd.init file to be more LSB compliant



Index: nsd.init
===================================================================
RCS file: /cvs/extras/rpms/nsd/devel/nsd.init,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- nsd.init	8 Nov 2007 16:21:14 -0000	1.8
+++ nsd.init	10 Nov 2008 04:51:54 -0000	1.9
@@ -2,7 +2,7 @@
 #
 # nsd:         Starts the NSD Name Server Daemon
 #
-# chkconfig: - 11 89
+# chkconfig: - 13 87
 # description:  NSD is a complete implementation of an authoritative \
 #               DNS name server. 
 # processname: /usr/sbin/nsd
@@ -10,50 +10,62 @@
 #
 ### BEGIN INIT INFO
 # Provides: nsd
-# Required-Start: $syslog
-# Default-Stop: 0 11 89
-# Short-Description: Starts the NSD Name Server Daemon
-# Description:  NSD is a complete implementation of an authoritative \
-#               DNS name server.
+# Required-Start: $local_fs $network $syslog
+# Required-Stop: $local_fs $network $syslog
+# Default-Start:
+# Short-Description: start|stop|status|restart|try-restart|reload|force-reload DNS server
+# Description: control NSD implementation of DNS server
 ### END INIT INFO
 
-# Sanity checks.
-[ -f /etc/nsd/nsd.conf ] || exit 0
-[ -x /usr/sbin/nsd ] || exit 0
-
 #extra verbosity
 #ZONEC_VERBOSE=-v
 OTHER_NSD_OPTS=""
 
 # Source function library.
-. /etc/init.d/functions
+. /etc/rc.d/init.d/functions
 
-. /etc/sysconfig/network
+[ -r /etc/sysconfig/nsd ] && . /etc/sysconfig/nsd
 
 # Check that networking is configured.
 [ ${NETWORKING} = "no" ] && exit 0
 
 start() {
-	echo -n $"Starting nsd... "
+  # Source networking configuration.
+  [ -r /etc/sysconfig/network ] && . /etc/sysconfig/network
+
+  # Check that networking is up
+  [ "${NETWORKING}" = "no" ] && exit 1
+
+  # Sanity checks.
+  [ -f /etc/nsd/nsd.conf ] || exit 5
+  [ -x /usr/sbin/nsd ] || exit 5
+
+	echo -n $"Starting nsd:"
 	/usr/sbin/nsdc rebuild >/dev/null 2>%1
 	nsd $OTHER_NSD_OPTS
 	RETVAL=$?
 	echo
-	touch /var/lock/subsys/nsd
-	return $RETVAL
+        if [ $RETVAL -eq 0 ]; then
+           touch /var/lock/subsys/named;
+        else
+           exit 7;
+        fi
+  return 0;
 }
 
 stop() {
-	echo -n $"Shutting down nsd services: "
+	echo -n $"Stopping nsd: "
 	# save state to zonefiles
 	/usr/sbin/nsdc patch > /dev/null 2>%1
-	killproc nsd
+	/usr/sbin/nsdc stop
 	RETVAL=$?
+	# was nsdc successful?
+	[ "$RETVAL" -eq 0 ] || killproc nsd -TERM >/dev/null 2>&1
 	if [ $RETVAL -eq 0 ] ; then
 	  rm -f /var/run/nsd/nsd.pid
+	  rm -f /var/lock/subsys/nsd
 	  # ensure notifies are sent at startup
 	  rm -f /var/lib/nsd/xfrd.state
-	  rm -f /var/lock/subsys/nsd
 	fi
 	echo
 	return $RETVAL
@@ -91,4 +103,4 @@
 	exit 1
 esac
 
-exit $?
+exit $RETVAL




More information about the fedora-extras-commits mailing list