Close TCP port 80 and 443 after forking in Django
- by audiodev
I am trying to fork() and exec() a new python script process from within a Django app that is running in apache2/WSGI Python. The new python process is daemonized so that it doesn't hold any association to apache2, but I know the HTTP ports are still open. The new process kills apache2, but as a result the new python process now holds port 80 and 443 open, and I don't want this.
How do I close port 80 and 443 from within the new python process? Is there a way to gain access to the socket handle descriptors so they can be closed?