We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, thanks for the great library. I have a question - is it possible to set PR_SET_PDEATHSIG on Linux for all running commands?
PR_SET_PDEATHSIG
When I use subprocess myself, I do it like:
SIGHUP = 1 PR_SET_PDEATHSIG = 1 libc = ctypes.CDLL("/lib64/libc.so.6") def set_pdeathsig_cb(): ppid = os.getpid() def cb(): res = libc.prctl(PR_SET_PDEATHSIG, SIGHUP) if res != 0: print(f"Fail to set PR_SET_PDEATHSIG. Return value: {res}", file=sys.stderr) sys.exit(1) if os.getppid() != ppid: print("Parent process has already died", file=sys.stderr) sys.exit(1) return cb with subprocess.Popen(cmd, preexec_fn=set_pdeathsig_cb()) as p: ...
Thank you.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, thanks for the great library.
I have a question - is it possible to set
PR_SET_PDEATHSIG
on Linux for all running commands?When I use subprocess myself, I do it like:
Thank you.
The text was updated successfully, but these errors were encountered: