Close fds before the child process is executed #1188

Merged
merged 1 commit into from Sep 4, 2014

Projects

None yet

2 participants

@tolbkni
Contributor
tolbkni commented Sep 2, 2014

All file descriptors except 0, 1 and 2 are closed before the child process is executed. (Unix only)

I call fabric.api.local function to start service in my python application, which open a port to accept HTTP connections, then stop the application, the opened port will be attached to the service! I cannot run my python application again, since the port is already used.

The default value of the executable parameter of the subprocess.Popen function is None, so we don't need the condition if shell is not None:

@tolbkni tolbkni Close fds before the child process is executed
all file descriptors except 0, 1 and 2 are closed before the child
process is executed. (Unix only)
b56d0b9
@bitprophet bitprophet added this to the 1.10 milestone Sep 3, 2014
@bitprophet bitprophet merged commit b56d0b9 into fabric:master Sep 4, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@bitprophet bitprophet added a commit that referenced this pull request Sep 4, 2014
@bitprophet bitprophet Add changelog re #1188, fixes #1188 e74755f
@tolbkni tolbkni deleted the tolbkni:fix-close_fds branch Sep 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment