Skip to content
Snippets Groups Projects
Commit c0086e80 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

daemonize() call added

parent 9c33b344
No related branches found
No related tags found
No related merge requests found
import sys
import os
def daemonize():
"""On POSIX-compatible systems, make the current process a daemon
No-op on Windows"""
if sys.platform == 'win32': return
try:
if os.fork() > 0: sys.exit(0)
except OSError:
sys.exit(1)
os.chdir("/")
os.setsid()
os.umask(0)
try:
if os.fork() > 0: sys.exit(0)
except OSError:
sys.exit(1)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment