Skip to content

Commit

Permalink
make sure a listener is inheritable
Browse files Browse the repository at this point in the history
fix #978
  • Loading branch information
benoitc committed Mar 6, 2015
1 parent eb485d2 commit 30177b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gunicorn/sock.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ def set_options(self, sock, bound=False):
if not bound:
self.bind(sock)
sock.setblocking(0)

# make sure that the socket can be inherited
if hasattr(sock, "set_inheritable"):
sock.set_inheritable(True)

sock.listen(self.conf.backlog)
return sock

Expand Down Expand Up @@ -110,6 +115,7 @@ def bind(self, sock):
util.chown(self.cfg_addr, self.conf.uid, self.conf.gid)
os.umask(old_umask)


def close(self):
super(UnixSocket, self).close()
os.unlink(self.cfg_addr)
Expand Down

0 comments on commit 30177b8

Please sign in to comment.