SHARE
TWEET

Untitled

a guest Mar 21st, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # disclaimer: behaviour as expected! - EPERM if there are pgroup-processes in the old session
  2. import os
  3. import psutil
  4.  
  5. from time import sleep
  6.  
  7. root = os.getpid()
  8. sleep(1)
  9. os.setpgid(0,0)
  10. pid = os.fork()
  11. if pid:
  12.     sleep(1)
  13.     os.setpgid(0, os.getppid())
  14.     sleep(1)
  15.     os.setsid()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top