Escalate to a SIGKILL in DroneUtility.kill_process() if the SIGTERM
didn't work
Signed-off-by: James Ren <jamesren@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@3825 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/utils.py b/client/common_lib/utils.py
index 26d116d..48a944c 100644
--- a/client/common_lib/utils.py
+++ b/client/common_lib/utils.py
@@ -543,10 +543,9 @@
return subproc.poll()
-def nuke_pid(pid):
+def nuke_pid(pid, signal_queue=(signal.SIGTERM, signal.SIGKILL)):
# the process has not terminated within timeout,
# kill it via an escalating series of signals.
- signal_queue = [signal.SIGTERM, signal.SIGKILL]
for sig in signal_queue:
if signal_pid(pid, sig):
return