Created
March 17, 2019 00:12
-
-
Save nefanov/52a9105098a05f050950c28f46cee5d9 to your computer and use it in GitHub Desktop.
group-->session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# disclaimer: behaviour as expected! - EPERM if there are pgroup-processes in the old session | |
import os | |
import psutil | |
from time import sleep | |
root = os.getpid() | |
sleep(1) | |
os.setpgid(0,0) | |
pid = os.fork() | |
if pid: | |
sleep(1) | |
os.setpgid(0, os.getppid()) | |
sleep(1) | |
os.setsid() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment