Geoffrey Young wrote:
It doesn't work in Child(Init|Exit) phases. Not only it doesn't exit, it
doesn't even log the error. See the test in my patch. Add die in
child_init() and you will see.
ok, that's problematic - anyplace you call die() from perl-land ought to
show up in the logs. the current behavior is bad (tm).
Right.
but if by exit you mean stop server startup, are you sure that's possible
within the confines of httpd? in prefork you might get no children ever
available to receive requests, but I'm not sure that you could make
apachectl return an error. are you?
That's why I ask. But not exiting is not an option. Not everybody checks
error_log for problems, and some people have too much noise in those files
to see something useful.
The fact that httpd ignores the child_init() return value is a problem
that needs to be fixed.
ok. and we can theoretically not ignore it in mod_perl-land. but what do
we do from it? we can issue croaks all day, but can we make httpd startup
stop within the child_init() callback currently?
I know, hence the question. I suppose the only option is to fix httpd.
Why httpd aborts on errors during the config, open_logs or post_config
phase, but not child_init? It sounds like an emission to me, since
child_init is very similar to any of preceeding to it phases.
The only problem I have is how to prevent from Apache to continue on
failure. Any ideas?
I'm not sure that it makes sense to halt apache on failure in these
phases.
you want to shut httpd down if a PerlChildExitHandler fails? these
aren't
part of startup processing so I don't see how they could prevent
apache from
starting.
While I somewhat agree about ChildExit, but not about ChildInit. I'm not
talking hypotethically. I want to use ChildInit for efficiency reasons,
and sometimes things fail, and I have no way to prevent the server from
happily starting.
ok, but that's a httpd issue, not a mod_perl one, right?
It's a mod_perl too, since at the moment die() called don't log their
error messages in error_log, but are simply ignored. (again see my test).
again, unless
httpd gives us a mechanism to halt the startup process it's kinda out of our
hands. unless you're saying httpd has a formal mechanism in place we can
use. if it doesn't I'd say we either need to offer a patch to httpd and
make things right going forward, or live with what httpd gives us.
I suppose the trickiness of this issue is that child_init runs in the
child process. So in order to prevent the server from starting, it needs
to somehow signal the problem to the parent problem, which given the
multitude of MPMs (where I think the child_init is called from) it might
be not so trivial.
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://mailchannels.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]