rpms/nsd/EL-5 nsd.init,1.6,1.7 nsd.spec,1.19,1.20

Paul Wouters pwouters at fedoraproject.org
Fri Apr 10 20:12:15 UTC 2009


Author: pwouters

Update of /cvs/extras/rpms/nsd/EL-5
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13466

Modified Files:
	nsd.init nsd.spec 
Log Message:
Fix init script to use sysconfig file.



Index: nsd.init
===================================================================
RCS file: /cvs/extras/rpms/nsd/EL-5/nsd.init,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- nsd.init	10 Apr 2009 18:58:45 -0000	1.6
+++ nsd.init	10 Apr 2009 20:11:45 -0000	1.7
@@ -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,11 +10,11 @@
 #
 ### BEGIN INIT INFO
 # Provides: nsd
-# Required-Start: $syslog
+# Required-Start: $local_fs $network $syslog
+# Required-Stop: $local_fs $network $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.
+# Short-Description: start|stop|status|restart|try-restart|reload|force-reload DNS server
+# Description: control NSD implementation of DNS server
 ### END INIT INFO
 
 # Init script default settings
@@ -26,37 +26,53 @@
 NSDC_PROG="/usr/sbin/nsdc"
 
 # 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
+[ "${NETWORKING}" = "no" ] && exit 0
 
 start() {
-	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
+  # Source networking configuration.
+  [ -r /etc/sysconfig/network ] && . /etc/sysconfig/network
+
+  # Check that networking is up
+  [ "${NETWORKING}" = "no" ] && exit 1
+
+  # Sanity checks.
+  [ -f $NSD_CONF ] || exit 5
+  [ -x $NSD_PROG ] || exit 5
+
+  echo -n $"Starting nsd:"
+  $NSDC_PROG -c $NSD_CONF rebuild >/dev/null 2>%1
+  $NSD_PROG -c $NSD_CONF $OTHER_NSD_OPTS
+  RETVAL=$?
+  echo
+        if [ $RETVAL -eq 0 ]; then
+           touch /var/lock/subsys/nsd;
+        else
+           exit 7;
+        fi
+  return 0;
 }
 
 stop() {
-	echo -n $"Shutting down nsd services: "
-	# save state to zonefiles
-	/usr/sbin/nsdc patch > /dev/null 2>%1
-	killproc nsd
-	RETVAL=$?
-	if [ $RETVAL -eq 0 ] ; then
-	  rm -f /var/run/nsd/nsd.pid
-	  # ensure notifies are sent at startup
-	  rm -f /var/lib/nsd/xfrd.state
-	  rm -f /var/lock/subsys/nsd
-	fi
-	echo
-	return $RETVAL
+  echo -n $"Stopping nsd: "
+  # save state to zonefiles
+  $NSDC_PROG -c $NSD_CONF patch > /dev/null 2>%1
+  $NSDC_PROG -c $NSD_CONF stop
+  RETVAL=$?
+  # was nsdc successful?
+  [ "$RETVAL" -eq 0 ] || killproc $NSD_PROG -TERM >/dev/null 2>&1
+  if [ $RETVAL -eq 0 ] ; then
+     rm -f $NSD_PIDFILE
+     rm -f /var/lock/subsys/nsd
+     # ensure notifies are sent at startup
+     rm -f $NSD_XFRDFILE
+  fi
+  echo
+  return $RETVAL
 }
 
 restart() {


Index: nsd.spec
===================================================================
RCS file: /cvs/extras/rpms/nsd/EL-5/nsd.spec,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- nsd.spec	10 Apr 2009 18:58:46 -0000	1.19
+++ nsd.spec	10 Apr 2009 20:11:45 -0000	1.20
@@ -100,6 +100,7 @@
 - updated to 3.2.1
 - fixed /dev/nul which cause a file /%1 to be written by cron
 - Applied Ville Mattila's changes to support non-default locations
+- Added --with-dbfile to point to the right place
 
 * Thu Oct  9 2008 Paul Wouters <paul at xelerance.com> - 3.1.1-1
 - updated to 3.1.1




More information about the fedora-extras-commits mailing list