mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Merge pull request #2731 from benoitc/daemonize-dev-null-stdin-inheritable
Ensure fd 0 stdin </dev/null is always inheritable Fixed #2727 .
This commit is contained in:
commit
238de4e3cf
1
THANKS
1
THANKS
@ -109,6 +109,7 @@ Kyle Mulka <repalviglator@yahoo.com>
|
|||||||
Lars Hansson <romabysen@gmail.com>
|
Lars Hansson <romabysen@gmail.com>
|
||||||
Leonardo Santagada <santagada@gmail.com>
|
Leonardo Santagada <santagada@gmail.com>
|
||||||
Levi Gross <levi@levigross.com>
|
Levi Gross <levi@levigross.com>
|
||||||
|
licunlong <shenxiaogll@163.com>
|
||||||
Łukasz Kucharski <lkucharski@leon.pl>
|
Łukasz Kucharski <lkucharski@leon.pl>
|
||||||
Mahmoud Hashemi <mahmoudrhashemi@gmail.com>
|
Mahmoud Hashemi <mahmoudrhashemi@gmail.com>
|
||||||
Malthe Borch <mborch@gmail.com>
|
Malthe Borch <mborch@gmail.com>
|
||||||
|
|||||||
@ -486,7 +486,10 @@ def daemonize(enable_stdio_inheritance=False):
|
|||||||
closerange(0, 3)
|
closerange(0, 3)
|
||||||
|
|
||||||
fd_null = os.open(REDIRECT_TO, os.O_RDWR)
|
fd_null = os.open(REDIRECT_TO, os.O_RDWR)
|
||||||
|
# PEP 446, make fd for /dev/null inheritable
|
||||||
|
os.set_inheritable(fd_null, True)
|
||||||
|
|
||||||
|
# expect fd_null to be always 0 here, but in-case not ...
|
||||||
if fd_null != 0:
|
if fd_null != 0:
|
||||||
os.dup2(fd_null, 0)
|
os.dup2(fd_null, 0)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user