mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
patch from @davisp, ease the code.
This commit is contained in:
parent
43dfb8f0f7
commit
7dd7b71523
@ -257,13 +257,13 @@ def daemonize():
|
|||||||
http://www.svbug.com/documentation/comp.unix.programmer-FAQ/faq_2.html#SEC16
|
http://www.svbug.com/documentation/comp.unix.programmer-FAQ/faq_2.html#SEC16
|
||||||
"""
|
"""
|
||||||
if not 'GUNICORN_FD' in os.environ:
|
if not 'GUNICORN_FD' in os.environ:
|
||||||
if os.fork() == 0:
|
if os.fork():
|
||||||
os.setsid()
|
|
||||||
if os.fork():
|
|
||||||
os._exit(0)
|
|
||||||
else:
|
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
|
os.setsid()
|
||||||
|
|
||||||
|
if os.fork():
|
||||||
|
os._exit(0)
|
||||||
|
|
||||||
os.umask(0)
|
os.umask(0)
|
||||||
maxfd = get_maxfd()
|
maxfd = get_maxfd()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user