mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fork twice as usual per request of davisp
This commit is contained in:
parent
80b4534922
commit
82ed62d35d
@ -57,14 +57,10 @@ def configure_logging(opts):
|
||||
|
||||
def daemonize(logger):
|
||||
if not 'GUNICORN_FD' in os.environ:
|
||||
pid = os.fork()
|
||||
if pid != 0:
|
||||
# Parent
|
||||
logger.debug("arbiter daemonized; parent exiting")
|
||||
os._exit(0)
|
||||
os.close(0)
|
||||
sys.stdin = sys.__stdin__ = open("/dev/null")
|
||||
if os.fork(): os._exit(0)
|
||||
os.setsid()
|
||||
if os.fork(): os._exit(0)
|
||||
sys.stdin = sys.__stdin__ = open("/dev/null")
|
||||
|
||||
def main(usage, get_app):
|
||||
parser = op.OptionParser(usage=usage, option_list=options())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user