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

Torsten Förtsch <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
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
$ 

Torsten Förtsch

-- 
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net
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.