rpms/bind/devel bind.spec,1.132,1.133 named.init,1.45,1.46

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Oct 5 13:06:27 UTC 2006


Author: stransky

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

Modified Files:
	bind.spec named.init 
Log Message:
added timeout to init script


Index: bind.spec
===================================================================
RCS file: /cvs/dist/rpms/bind/devel/bind.spec,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -r1.132 -r1.133
--- bind.spec	5 Oct 2006 11:14:27 -0000	1.132
+++ bind.spec	5 Oct 2006 13:06:25 -0000	1.133
@@ -785,6 +785,9 @@
 * Thu Oct 5 2006 Martin Stransky <stransky at redhat.com> - 30:9.3.3-3
 - 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.
 
 * Mon Oct 2 2006 Martin Stransky <stransky at redhat.com> - 30:9.3.3-2
 - removed chcon from post script, replaced by restorecon 


Index: named.init
===================================================================
RCS file: /cvs/dist/rpms/bind/devel/named.init,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- named.init	5 Oct 2006 11:14:27 -0000	1.45
+++ named.init	5 Oct 2006 13:06:25 -0000	1.46
@@ -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`;
@@ -194,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