On Thu, Mar 20, 2003 at 07:20:22PM -0800, Aaron Bannert wrote:
> > + /* close these before exec. */
> > + apr_file_unset_inherit((*pod)->pod_in);
> > + apr_file_unset_inherit((*pod)->pod_out);
> > +
> > return APR_SUCCESS;
>
> The PODs in the worker MPM are getting closed and the parent is then
> unable to kill its children when it needs to (don't you love how
> morbid that sounds?). I see one of these every second in the error log:
>
> [Thu Mar 20 18:09:25 2003] [warn] (32)Broken pipe: write pipe_of_death
I haven't seen that, though HEAD is behaving strangely, I think it may
be some of Bill's filedup.c changes in APR. If you back down to rev
1.56 of filedup.c does this go away? I'm seeing a close(2) happening
too early with 1.57 and later, which results in this nice trick:
open("/path/to/logs/access_log", O_WRONLY|O_APPEND|O_CREAT, 0666) = 2
open("/path/to/logs/error_log", O_RDWR|O_APPEND|O_CREAT, 0666) = 4
dup2(4, 2) = 2
> Since the unset_inherit() is being called from the open_logs hook, it's
> happening in the parent process, which means that the fork for
> the children is going to kill them off. We need to unset the inherit
> *after* we are running in the child.
My discovery at the beginning of this expedition was that child_cleanups
are only run before the exec() in apr_proc_create(), so I'm not sure why
a fork() would close anything?
Regards,
joe