On 5 August 2013 22:52, Victor Stinner
I checked the python-daemon module: it closes all open file descriptors except 0, 1, 2. It has a files_preserve attribute to keep some FD opens. It redirects stdin, stdout and stderr to /dev/null and keep these file descriptors open. If python-daemon is used to execute a new program, the files_preserve list can be used to mark these file descriptors as inherited.
The zdaemon.zdrun module closes all open file descriptors except 0, 1, 2. It uses also dup2() to redirect stdout and stderr to the write end of a pipe.
So closed by default, and directing people towards subprocess and python-daemon if they need to keep descriptors open sounds really promising. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia