Skip to content

Commit

Permalink
[core] Fixes #434
Browse files Browse the repository at this point in the history
+ Fix inspired from
http://stackoverflow.com/questions/4789837/how-to-terminate-a-python-subprocess-launched-with-shell-true/4791612#4791612.
+ Kills the process group leader, whose signal is transmitted to all of the child processes of the group
  • Loading branch information
viyatb committed Mar 22, 2016
1 parent cfe1a5e commit c50fb65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/shell/blocking_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def shell_exec_monitor(self, Command, PluginInfo):
logging.warn(outdata)
Output += outdata
try:
os.kill(proc.pid, signal.SIGTERM) # Plugin KIA (Killed in Action)
os.killpg(os.getpgid(proc.pid), signal.SIGTERM) # Plugin KIA (Killed in Action)
except OSError:
pass # Plugin RIP (Rested In Peace)
Cancelled = True
Expand Down

0 comments on commit c50fb65

Please sign in to comment.