mirror of https://github.com/krallin/tini.git
Merge pull request #16 from krallin/dpw-kill-process-group
Support for kill process group, thanks @dpw!pull/24/head
commit
cf1cb5c4f6
5 changed files with 96 additions and 4 deletions
@ -0,0 +1,18 @@ |
||||
#!/usr/bin/env python |
||||
import os |
||||
import subprocess |
||||
import signal |
||||
|
||||
|
||||
def reset_sig_handler(): |
||||
signal.signal(signal.SIGUSR1, signal.SIG_DFL) |
||||
|
||||
|
||||
if __name__ == "__main__": |
||||
signal.signal(signal.SIGUSR1, signal.SIG_IGN) |
||||
p = subprocess.Popen( |
||||
["sleep", "1000"], |
||||
preexec_fn=reset_sig_handler |
||||
) |
||||
p.wait() |
||||
|
Loading…
Reference in new issue