1

I am running mod_wsgi and Django on apache2 httpd 2.2.12. I do quite a few os.system() and subprocess.Popen() calls, and was wondering: is there any option/directive to configure apache2 so that the prefork child processes close all file descriptors except what is used to communicate with the main prefork process?

If I receive a request to start a process, and then apache restarts, it has been observed that some of those apache-initiated processes inherit the apache descriptors (i.e. port 80), causing apache to have trouble binding on a restart. I am looking for a way to close all descriptors that aren't being used.

Perhaps the ability to have the port 80 descriptor open in a child is a feature to allow anyone to take over if the main process crashes?

1 Answer 1

0

Ths is a duplicate of the same question on mod_wsgi mailing list.

The quick summary is that it is generally bad pratice to be doing sub process execution from web server processes directly. More details will be provided in the discussion on the mod_wsgi mailing list.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .