Commit 37966187 authored by Shane Kerr's avatar Shane Kerr
Browse files

Change shutdown to actually SIGKILL properly.



git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1675 e5f2f494-b856-4b98-b285-d166d9295462
parent 0532e260
......@@ -363,7 +363,6 @@ class BoB:
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 @@ class BoB:
# 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")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment