Exiting process doesn't trigger ErrorDocument 500

--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

<html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; ">Hello<div><br></div><div>I'm =
running Perl programs in mod_perl in Apache (2.2) on RHEL, using the =
prefork MPM.</div><div>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 <span class=3D"Apple-style-span" =
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; "><span =
class=3D"Apple-style-span" style=3D"font-family: Verdana; font-size: =
13px; "><a =
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</a></span></span>. =
Processes that grow to large die with "Out of Memory!" and =
"Callback called exit."</div><div>I had hoped to give some users some =
feedback via Apache's <a =
href=3D"http://httpd.apache.org/docs/2.0/mod/core.html#error document">Erro=
rDocument</a> (also described in <a =
href=3D"http://httpd.apache.org/docs/2.0/custom-error.html"> Custom Error =
Response</a>). While that can run local Perl (in a new process of =
course) as in the example</div><div><div><font =
size=3D"+1"><code>       </code></font><span =
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; "><span class=3D"Apple-style-span" style=3D"font-family: 'Courier =
New', Courier, monospace; font-size: 19px; line-height: 20px; =
">ErrorDocument 500 =
/cgi-bin/crash-recover.pl</span></span></div></div><div>exiting process =
doesn't trigger ErrorDocument 500. </div><div>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.</div><div><br></div><div>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?</div><div><br></div><div>BR</div><div>A</div><div><br></div></body></=
html>=

--Apple-Mail-3-555745201--
ArthurG [ Di, 16 März 2010 22:00 ] [ ID #2035280 ]

Re: Exiting process doesn't trigger ErrorDocument 500

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.

--
Nick Kew=

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
Nick Kew [ Do, 18 März 2010 09:34 ] [ ID #2035567 ]
Webserver » gmane.comp.apache.user » Exiting process doesn't trigger ErrorDocument 500

Vorheriges Thema: Re: Apache proxy based on condition
Nächstes Thema: apache and php on windows