Re: Getting a non-zero error code from httpd(1) if the application doesn't compile

Ævar Arnfjörð Bjarmason <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CACBZZX6h6oWS_22fRDs=4YYFvq_LaqdnRrLr4kH9suD46s-60w@mail.gmail.com>
On Sat, Oct 15, 2011 at 19:35, Torsten Förtsch <[email protected]> wrote:
> On Saturday, 15 October 2011 18:00:26 Ævar Arnfjörð Bjarmason wrote:
>> Maybe this is something elementary that I've just missed, but it seems
>> to me that when transitioning from mod_perl 1 to 2 there's no way to
>> get a non-zero exit code from Apache if your application has
>> compilation errors.
>>
>> I have an application that I'm loading like this:
>>
>>     PerlPostConfigRequire     /usr/local/myapp/startup.pm
>
> How about loading it earlier?
>
> $ cat xx
> <Perl>
> use POSIX();
> POSIX::exit(15);
> </Perl>
> $ httpd -c 'Include "'$PWD/xx'"'; echo $?
> 15
> $ cat xx
> <Perl>
> die
> </Perl>
> $ httpd -c 'Include "'$PWD/xx'"'; echo $?
> Syntax error on line 2 of /.../xx:
> \t(in cleanup) Died at /.../xx line 2.\n
> 1
> $

I can load code earlier, but unless I'm misunderstanding something the
PerlInterpreter running that code *won't* be the one that'll be forked
and serving requests.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.