Exiting process doesn"t trigger ErrorDocument 500

Exiting process doesn"t trigger ErrorDocument 500

am 16.03.2010 22:00:37 von ArthurG

--Apple-Mail-3-555745201
Content-Type: text/plain;
charset=US-ASCII;
format=flowed;
delsp=yes
Content-Transfer-Encoding: 7bit

Hello

I'm running Perl programs in mod_perl in Apache (2.2) on RHEL, using
the prefork MPM.
I want to protect my server against Perl processes that grow much too
large, as they can slow or even freeze the system. So I've setup an
address space resource limit via Perl's Apache2::SizeLimit. Processes
that grow to large die with "Out of Memory!" and "Callback called exit."
I had hoped to give some users some feedback via Apache's
ErrorDocument (also described in Custom Error Response). While that
can run local Perl (in a new process of course) as in the example
ErrorDocument 500 /cgi-bin/crash-recover.pl
exiting process doesn't trigger ErrorDocument 500.
Alternatively, I tried to output status to users via a SIG handler for
__DIE__, but STDERR is closed by the time the SIG handler runs.

Is there a way to configure this, or another way to provide some error
output to a browser that sent a Request that caused the server process
to die?

BR
A


--Apple-Mail-3-555745201
Content-Type: text/html;
charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

-webkit-line-break: after-white-space; ">Hello


I'm =
running Perl programs in mod_perl in Apache (2.2) on RHEL, using the =
prefork MPM.
I want to protect my server against Perl =
processes that grow much too large, as they can slow or even freeze the =
system. So I've setup an address space resource limit =
via Perl's  style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
'Times New Roman'; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; font-size: medium; "> class=3D"Apple-style-span" style=3D"font-family: Verdana; font-size: =
13px; "> href=3D"http://search.cpan.org/%7Egozer/mod_perl-2.0.4/docs/ api/Apache2/Si=
zeLimit.pod" id=3D"j:1-" =
title=3D"Apache2::SizeLimit">Apache2::SizeLimit
. =
Processes that grow to large die with "Out of Memory!" and =
"Callback called exit."
I had hoped to give some users some =
feedback via Apache's  href=3D"http://httpd.apache.org/docs/2.0/mod/core.html#error document">Erro=
rDocument
 (also described in  href=3D"http://httpd.apache.org/docs/2.0/custom-error.html"> Custom Error =
Response
). While that can run local Perl (in a new process of =
course) as in the example
size=3D"+1">        class=3D"Apple-style-span" style=3D"border-collapse: separate; color: =
rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 20px; =
font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: 2; text-indent: =
0px; text-transform: none; white-space: normal; widows: 2; word-spacing: =
0px; "> New', Courier, monospace; font-size: 19px; line-height: 20px; =
">ErrorDocument 500 =
/cgi-bin/crash-recover.pl
exiting process =
doesn't trigger ErrorDocument 500. 
Alternatively, I =
tried to output status to users via a SIG handler for __DIE__, but =
STDERR is closed by the time the SIG handler =
runs.

Is there a way to configure this, or =
another way to provide some error output to a browser that sent a =
Request that caused the server process to =
die?

BR
A

html>=

--Apple-Mail-3-555745201--

Re: Exiting process doesn"t trigger ErrorDocument 500

am 18.03.2010 09:34:02 von Nick Kew

On 16 Mar 2010, at 21:00, ARTHUR GOLDBERG wrote:

> Is there a way to configure this, or another way to provide some error =
output to a browser that sent a Request that caused the server process =
to die?

Error 500 is totally different to server dying. If you could bail out =
without dying
(soft death?) you're fine, otherwise no chance.

You could also hack it by reverse proxying the dying app.

--=20
Nick Kew=

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org