Created
April 3, 2017 22:18
-
-
Save blythest/6cd30bc5fc5953739b6d763801d94e97 to your computer and use it in GitHub Desktop.
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
import os | |
import sys | |
def main(command): | |
pid = os.fork() | |
if 0 != pid: | |
return | |
sys.stdin.close() | |
sys.stdout.close() | |
sys.stderr.close() | |
os.setsid() | |
pid = os.fork() | |
if 0 != pid: | |
return | |
os.system(command) | |
sys.exit() | |
if __name__ == "__main__": | |
main(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment