提交 cf0d3af2 编写于 作者: L Lukáš Doktor

avocado.utils.process: Make "SIGCONT" optional in kill_process_tree

The "kill_process_tree" executes desired kill and then it sends
SIGCONT to the pid. In some cases (like sending SIGSTOP) this is
undesirable, but on a lot of places the code assumes it sends it.
So let's add "send_sigcont=True", which allows one to disable it
in his particular case.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 3b1bd8d9
......@@ -113,7 +113,7 @@ def safe_kill(pid, signal):
return False
def kill_process_tree(pid, sig=signal.SIGKILL):
def kill_process_tree(pid, sig=signal.SIGKILL, send_sigcont=True):
"""
Signal a process and all of its children.
......@@ -129,7 +129,8 @@ def kill_process_tree(pid, sig=signal.SIGKILL):
for child in children:
kill_process_tree(int(child), sig)
safe_kill(pid, sig)
safe_kill(pid, signal.SIGCONT)
if send_sigcont:
safe_kill(pid, signal.SIGCONT)
def kill_process_by_pattern(pattern):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册