mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix issue #142. Thanks
This commit is contained in:
parent
7436161800
commit
cd726f6d8c
@ -3,6 +3,6 @@
|
||||
# This file is part of gunicorn released under the MIT license.
|
||||
# See the NOTICE for more information.
|
||||
|
||||
version_info = (0, 12, 0)
|
||||
version_info = (0, 12, 1)
|
||||
__version__ = ".".join(map(str, version_info))
|
||||
SERVER_SOFTWARE = "gunicorn/%s" % __version__
|
||||
|
||||
@ -254,20 +254,18 @@ def is_hoppish(header):
|
||||
|
||||
def daemonize():
|
||||
"""\
|
||||
Standard daemonization of a process. Code is basd on the
|
||||
ActiveState recipe at:
|
||||
http://code.activestate.com/recipes/278731/
|
||||
Standard daemonization of a process.
|
||||
http://www.svbug.com/documentation/comp.unix.programmer-FAQ/faq_2.html#SEC16
|
||||
"""
|
||||
if not 'GUNICORN_FD' in os.environ:
|
||||
if os.fork() == 0:
|
||||
os.setsid()
|
||||
if os.fork() != 0:
|
||||
os.umask(0)
|
||||
else:
|
||||
if os.fork():
|
||||
os._exit(0)
|
||||
else:
|
||||
os._exit(0)
|
||||
|
||||
|
||||
os.umask(0)
|
||||
maxfd = get_maxfd()
|
||||
|
||||
# Iterate through and close all file descriptors.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user