데몬화 함수
# 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
Archived
2004. 7. 24. 16:35