Revert "add GUNICORN_INHERIT_FDS environment variable support"

This reverts commit c9fcb25f51db9ae67f9585c93924e5af8b8bb8b8.
This commit is contained in:
benoitc 2013-04-22 19:05:31 +02:00
parent 612f4125dd
commit 2e2432c91b

View File

@ -418,32 +418,11 @@ def daemonize():
os.umask(0)
maxfd = get_maxfd()
fds = []
if 'GUNICORN_INHERIT_FDS' in os.environ:
list_fds = os.environ['GUNICORN_INHERIT_FDS'].split(',')
try:
fds = [int(fd) for fd in list_fds]
except ValueError:
raise RuntimeError("Bad value in 'GUNICORN_INHERIT_FDS'")
for fd in range(0, max_fd):
if fd in fds:
continue
try:
os.close(fd)
except OSError: # ERROR, fd wasn't open to begin with (ignored)
pass
else:
closerange(0, maxfd)
closerange(0, maxfd)
os.open(REDIRECT_TO, os.O_RDWR)
if 1 not in fds:
os.dup2(0, 1)
if 2 not in fds:
os.dup2(0, 2)
os.dup2(0, 1)
os.dup2(0, 2)
def seed():