분류 전체보기 (119)
Wi-Fi LED Matrix (1)
Code snippets (4)
Music (2)
MacOS & iOS (10)
Linux & Android (22)
Windows & WM (18)
Electronic (20)
Archived (32)
Trash Bin (10)
422,699 Visitors up to today!
Today 37 hit, Yesterday 203 hit
2004.07.24 16:35

# python 스크립트를 데몬화 해줌.

 

def daemonize():
    if os.fork(): sys.exit()
    os.setsid()
    signal.signal(signal.SIGCHLD, signal.SIG_IGN)
    if os.fork(): sys.exit()
    signal.signal(signal.SIGCHLD, signal.SIG_DFL)
    os.umask(022)
    sys.stderr = open('/dev/null', 'w')
    sys.stdout = sys.stderr

신고