Geoffrey Young wrote:

Stas Bekman wrote:

[EMAIL PROTECTED] wrote:


Author: geoff
Date: Tue Jan 24 05:55:39 2006
New Revision: 371915

URL: http://svn.apache.org/viewcvs?rev=371915&view=rev
Log:
add simple tests to make sure $ENV{MOD_PERL}
and $ENV{MOD_PERL_API_VERSION} are set as soon
as possible

Modified:
   perl/modperl/trunk/t/conf/extra.last.conf.in
   perl/modperl/trunk/t/hooks/TestHooks/startup.pm

Modified: perl/modperl/trunk/t/conf/extra.last.conf.in
URL:
http://svn.apache.org/viewcvs/perl/modperl/trunk/t/conf/extra.last.conf.in?rev=371915&r1=371914&r2=371915&view=diff

==============================================================================

--- perl/modperl/trunk/t/conf/extra.last.conf.in (original)
+++ perl/modperl/trunk/t/conf/extra.last.conf.in Tue Jan 24 05:55:39 2006
@@ -67,6 +67,13 @@
$TestDirective::perl::base_server = Apache2::PerlSections->server;
</Perl>

+<Perl >
+# make sure that these are set at the earliest possible time
+die '$ENV{MOD_PERL} not set!' unless $ENV{MOD_PERL};
+die '$ENV{MOD_PERL_API_VERSION} not set!'
+    unless $ENV{MOD_PERL_API_VERSION} == 2;
+</Perl>
+


The only issue here is that Apache ignores any failures in the mp land
at the server startup and it'll still start regardless.


that isn't what I observed - I put a die in there and the other place and
the server didn't start.  granted, the error message wasn't all that
informative, but it did keep the server from starting... at least with the
apache I tested :)

Ah, of course, it does respect failures during the config phase, but ignores them in post_config, open_logs and child_init. So your patch is just perfect, Geoff.

But as we know
this die shouldn't happen I guess it's OK. (and of course everybody
observes error_log during the test suite run :)


actually, I couldn't get the open_logs handler to spit errors to the
error_log, which I guess is kinda the risk you run when messing around with
that phase...

Probably because it's not yet open, it's open only on restart. Most of our code here at mailchannels we skip the init on the server startup, and only run it on the restart, when error_log is available.

--
_____________________________________________________________
Stas Bekman mailto:[EMAIL PROTECTED]  http://stason.org/
MailChannels: Assured Messaging(TM) http://mailchannels.com/
The "Practical mod_perl" book       http://modperlbook.org/
http://perl.apache.org/ http://perl.org/ http://logilune.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to