[svn] commit: r1675 - /trunk/src/bin/bind10/bind10.py.in

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Apr 6 08:56:43 UTC 2010


Author: shane
Date: Tue Apr  6 08:56:43 2010
New Revision: 1675

Log:
Change shutdown to actually SIGKILL properly.


Modified:
    trunk/src/bin/bind10/bind10.py.in

Modified: trunk/src/bin/bind10/bind10.py.in
==============================================================================
--- trunk/src/bin/bind10/bind10.py.in (original)
+++ trunk/src/bin/bind10/bind10.py.in Tue Apr  6 08:56:43 2010
@@ -363,7 +363,6 @@
         self.reap_children()
         # next try sending a SIGTERM
         processes_to_stop = list(self.processes.values())
-        unstopped_processes = []
         for proc_info in processes_to_stop:
             if self.verbose:
                 sys.stdout.write("Sending SIGTERM to %s (PID %d).\n" % 
@@ -374,21 +373,22 @@
                 # ignore these (usually ESRCH because the child
                 # finally exited)
                 pass
-        # XXX: some delay probably useful... how much is uncertain
-        time.sleep(0.1)  
-        self.reap_children()
-        # finally, send a SIGKILL (unmaskable termination)
-        processes_to_stop = unstopped_processes
-        for proc_info in processes_to_stop:
-            if self.verbose:
-                sys.stdout.write("Sending SIGKILL to %s (PID %d).\n" % 
-                                 (proc_info.name, proc_info.pid))
-            try:
-                proc_info.process.kill()
-            except OSError:
-                # ignore these (usually ESRCH because the child
-                # finally exited)
-                pass
+        # finally, send SIGKILL (unmaskable termination) until everybody dies
+        while self.processes:
+            # XXX: some delay probably useful... how much is uncertain
+            time.sleep(0.1)  
+            self.reap_children()
+            processes_to_stop = list(self.processes.values())
+            for proc_info in processes_to_stop:
+                if self.verbose:
+                    sys.stdout.write("Sending SIGKILL to %s (PID %d).\n" % 
+                                     (proc_info.name, proc_info.pid))
+                try:
+                    proc_info.process.kill()
+                except OSError:
+                    # ignore these (usually ESRCH because the child
+                    # finally exited)
+                    pass
         if self.verbose:
             sys.stdout.write("All processes ended, server done.\n")
 




More information about the bind10-changes mailing list