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.
|
# This file is part of gunicorn released under the MIT license.
|
||||||
# See the NOTICE for more information.
|
# See the NOTICE for more information.
|
||||||
|
|
||||||
version_info = (0, 12, 0)
|
version_info = (0, 12, 1)
|
||||||
__version__ = ".".join(map(str, version_info))
|
__version__ = ".".join(map(str, version_info))
|
||||||
SERVER_SOFTWARE = "gunicorn/%s" % __version__
|
SERVER_SOFTWARE = "gunicorn/%s" % __version__
|
||||||
|
|||||||
@ -254,20 +254,18 @@ def is_hoppish(header):
|
|||||||
|
|
||||||
def daemonize():
|
def daemonize():
|
||||||
"""\
|
"""\
|
||||||
Standard daemonization of a process. Code is basd on the
|
Standard daemonization of a process.
|
||||||
ActiveState recipe at:
|
http://www.svbug.com/documentation/comp.unix.programmer-FAQ/faq_2.html#SEC16
|
||||||
http://code.activestate.com/recipes/278731/
|
|
||||||
"""
|
"""
|
||||||
if not 'GUNICORN_FD' in os.environ:
|
if not 'GUNICORN_FD' in os.environ:
|
||||||
if os.fork() == 0:
|
if os.fork() == 0:
|
||||||
os.setsid()
|
os.setsid()
|
||||||
if os.fork() != 0:
|
if os.fork():
|
||||||
os.umask(0)
|
|
||||||
else:
|
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
else:
|
else:
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
|
|
||||||
|
os.umask(0)
|
||||||
maxfd = get_maxfd()
|
maxfd = get_maxfd()
|
||||||
|
|
||||||
# Iterate through and close all file descriptors.
|
# Iterate through and close all file descriptors.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user