rpms/bind/FC-5 bind.spec,1.108,1.109 named.init,1.44,1.45

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Oct 16 10:21:20 UTC 2006


Author: stransky

Update of /cvs/dist/rpms/bind/FC-5
In directory cvs.devel.redhat.com:/tmp/cvs-serv3643

Modified Files:
	bind.spec named.init 
Log Message:
init script improvement


Index: bind.spec
===================================================================
RCS file: /cvs/dist/rpms/bind/FC-5/bind.spec,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -r1.108 -r1.109
--- bind.spec	16 Oct 2006 09:54:52 -0000	1.108
+++ bind.spec	16 Oct 2006 10:21:15 -0000	1.109
@@ -780,7 +780,12 @@
 %changelog
 * Mon Oct 16 2006 Martin Stransky <stransky at redhat.com> - 30:9.3.3-0.1.rc2
 - update to the latest upstream (9.3.3rc2)
-- backported some fixes from devel
+- added fix from #209400 - Bind Init Script does not create
+  the PID file always, created by Jeff Means
+- added timeout to stop section of init script.
+  The default is 100 sec. and can be adjusted by NAMED_SHUTDOWN_TIMEOUT
+  shell variable.
+- backported some minor fixes from devel
 
 * Mon Sep 11 2006 Martin Stransky <stransky at redhat.com> - 30:9.3.2-33
 - added fix for CVE-2006-4095


Index: named.init
===================================================================
RCS file: /cvs/dist/rpms/bind/FC-5/named.init,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- named.init	21 Jul 2006 21:06:09 -0000	1.44
+++ named.init	16 Oct 2006 10:21:15 -0000	1.45
@@ -19,6 +19,9 @@
 
 [ -r /etc/sysconfig/named ] && . /etc/sysconfig/named
 
+# Don't kill named dunring clean-up
+NAMED_SHUTDOWN_TIMEOUT=${NAMED_SHUTDOWN_TIMEOUT:-100}
+
 if [ -n "$ROOTDIR" ]; then
    ROOTDIR=`echo $ROOTDIR | sed 's#//*#/#g;s#/$##'`;
    rdl=`/usr/bin/readlink $ROOTDIR`;
@@ -162,6 +165,16 @@
 		   ln -s $ROOTDIR/var/run/named/named.pid /var/run/named_sdb.pid;
 	       fi;
 	   fi;
+	   if [ -n "`/sbin/pidof -o %PPID $named`" ]; then
+	       # Verify that named actually started (JM 2006-10-04)
+	       if [ ! -e $ROOTDIR/var/run/named/named.pid ]; then
+		  # If there is not a file containing the PID of the now running named daemon then create it (JM 2006-10-04)
+		  echo `/sbin/pidof -o %PPID $named` > $ROOTDIR/var/run/named/named.pid;
+		  if [ "$named" = "named_sdb" ]; then
+		     echo `/sbin/pidof -o %PPID $named` > $ROOTDIR/var/run/named/named_sdb.pid;
+		  fi;
+	       fi;
+	   fi;
 	else
 	   named_err="`/usr/sbin/named-checkconf $ckcf_options $named_conf 2>&1`";	   
 	   echo
@@ -184,17 +197,26 @@
 	/usr/sbin/rndc stop >/dev/null 2>&1 
 	RETVAL=$?
 	if [ $RETVAL -eq 0 ]; then
+            timeout=0
+            while : ; do
+		if /sbin/pidof -o %PPID $named >/dev/null; then
+         	   if [ $timeout -ge $NAMED_SHUTDOWN_TIMEOUT ]; then
+		   	killproc $named -TERM >/dev/null 2>&1
+	           	RETVAL=$?
+			break
+        	   else
+			sleep 2 && echo -n "."
+			timeout=$((timeout+2))
+		   fi;
+		else
+		   break
+                fi;
+            done
+	fi;
+	if [ $RETVAL -eq 0 ]; then
 	    rm -f /var/lock/subsys/named
-	    rm -f /var/run/named.pid	    
+	    rm -f /var/run/named.pid
 	    rm -f /var/run/named_sdb.pid 2>/dev/null	    
-	elif /sbin/pidof -o %PPID $named >/dev/null; then
-	    killproc $named -TERM >/dev/null 2>&1
-	    RETVAL=$?
-	    if [ $RETVAL -eq 0 ]; then
-		rm -f /var/lock/subsys/named
-		rm -f /var/run/named.pid
-		rm -f /var/run/named_sdb.pid 2>/dev/null	    
-	    fi;
 	fi;
 	if [ $RETVAL -eq 0 ]; then
 	    success




More information about the fedora-cvs-commits mailing list