apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Rooney" <roo...@electricjellyfish.net>
Subject Re: apr_proc_create
Date Tue, 11 Apr 2006 18:12:52 GMT
On 4/11/06, Mike Behne <mdb32402@yahoo.com> wrote:
> I have a question about behavior of a process launched by apr_proc_create
> from within an Apache plugin module on Windows.
> The created process is intended to remain running regardless of whether the
> Apache server is running.  I'm noticing that after the process is created,
> and the Apache server is stopped and I attempt to restart it, I get an
> indication that the socket (port 80) is in use and Apache won't start.  Once
> I stop the created process, Apache can successfully start.  I tried a few
> things to change this behavior--apr_procattr_cmdtype_set,
> apr_procattr_detach_set, apr_proc_detach--but no change.  Now I've
> implemented some techniques to take the created proc down when Apache stops
> to avoid the failed restart.  Is there anything I could do differently that
> would allow the created proc to stay up without preventing Apache from
> restarting?

I suspect the problem is that the socket httpd is listening on is set
to be inherited (as you'd expect, since it's created in a parent
process and inherited by worker processes who do the accept), but what
you want is for it to not be inheritted by subsequent child processes.
 There are functions to control this inheritance,
apr_socket_inherit_unset and apr_socket_inherit_set, but I'm not sure
if there's an easy way to get at the appropriate socket to call them
from your module.  It might need to be done inside the httpd core.  On
the other hand, I could be wrong, I'm just theorizing at this point.


View raw message