Re: How to recognize server shutdown?

2001-01-11 Thread Stas Bekman
On Wed, 10 Jan 2001, Perrin Harkins wrote: On Thu, 11 Jan 2001, Stas Bekman wrote: the parent process doesn't run the END block. Randal's solution is probably better, But it's not a very nice solution if you want to release something on CPAN that relies on this hack. A support from

Re: How to recognize server shutdown?

2001-01-11 Thread G.W. Haywood
Hi all, On 10 Jan 2001, Randal L. Schwartz wrote: Here's an idea... in the startup code, create a pipe and fork. block the kid on a read. ni-night, kid. Nice, Randall! 73, Ged.

Re: How to recognize server shutdown?

2001-01-11 Thread Perrin Harkins
but it's a bummer that the parent doesn't run END blocks. Will it run cleanup handlers? Cleanup handlers are run by child processes. What it has to do with parent? Or do I miss something? I meant "is there a way to run a cleanup handler in the parent after it's work is done?", but I

Re: How to recognize server shutdown?

2001-01-11 Thread Doug MacEachern
On Thu, 11 Jan 2001, Perrin Harkins wrote: but it's a bummer that the parent doesn't run END blocks. Will it run cleanup handlers? Cleanup handlers are run by child processes. What it has to do with parent? Or do I miss something? cleanup handlers are run when a pool is cleared.

Re: How to recognize server shutdown?

2001-01-11 Thread Dave Rolsky
On Thu, 11 Jan 2001, Perrin Harkins wrote: I meant "is there a way to run a cleanup handler in the parent after it's work is done?", but I don't see one. Dave says the END block trick worked for him, so maybe it only fails under certain circumstances. Actually, I should have pointed out

Re: How to recognize server shutdown?

2001-01-11 Thread Doug MacEachern
On Wed, 10 Jan 2001, Stas Bekman wrote: All we need is to add a $Apache::Server::Quitting or alike, in addition to the existing $Apache::Server::Starting and $Apache::Server::ReStarting, should be an easy patch in XS. nooo, as i've mentioned before Starting,ReStarting variables were

Re: How to recognize server shutdown?

2001-01-11 Thread Ernest Lergon
Doug MacEachern wrote: I meant "is there a way to run a cleanup handler in the parent after it's work is done?", but I don't see one. Dave says the END block trick worked for him, so maybe it only fails under certain circumstances. of course, there is such a "trick" [EMAIL

Re: How to recognize server shutdown?

2001-01-11 Thread Perrin Harkins
On Thu, 11 Jan 2001, Doug MacEachern wrote: of course, there is such a "trick" [EMAIL PROTECTED]">http://forum.swarthmore.edu/epigone/modperl/thandflunjimp/[EMAIL PROTECTED] Documentation patch attached. - Perrin 1039a1040,1046 Cleanup functions registered in the parent process (before

Re: How to recognize server shutdown?

2001-01-10 Thread G.W. Haywood
Hi Dave, On Wed, 10 Jan 2001, Dave Rolsky wrote: Is there any way to distinguish between a child being shutdown (say maxrequests has been exceeded) versus all of Apache going down (kill signal sent to the original process or something). Don't you get a message in error_log to the effect

Re: How to recognize server shutdown?

2001-01-10 Thread Dave Rolsky
On Wed, 10 Jan 2001, G.W. Haywood wrote: Don't you get a message in error_log to the effect that a signal has been received? Sure, but I don't think that would help me do what I want. Let me illustrate: 1. server is started 2. config is read, modules are loaded, BEGIN blocks are run in

Re: How to recognize server shutdown?

2001-01-10 Thread Danny Rathjens
Dave Rolsky wrote: On Wed, 10 Jan 2001, G.W. Haywood wrote: Don't you get a message in error_log to the effect that a signal has been received? Sure, but I don't think that would help me do what I want. Let me illustrate: 1. server is started 2. config is read, modules are

Re: How to recognize server shutdown?

2001-01-10 Thread Robin Berjon
At 18:55 10/01/2001 +, Danny Rathjens wrote: Perhaps you could send a USR1 prior to your TERM signal and have your END blocks perform your shutdown tasks if they see the USR1 signal. But then you have the problem of new children being started due to the USR1 not to mention it would preclude

Re: How to recognize server shutdown?

2001-01-10 Thread Dave Rolsky
On Wed, 10 Jan 2001, Danny Rathjens wrote: Perhaps you could send a USR1 prior to your TERM signal and have your END blocks perform your shutdown tasks if they see the USR1 signal. But then you have the problem of new children being started due to the USR1 not to mention it would preclude

Re: How to recognize server shutdown?

2001-01-10 Thread G.W. Haywood
Hi there, On Wed, 10 Jan 2001, Dave Rolsky wrote: On Wed, 10 Jan 2001, G.W. Haywood wrote: Don't you get a message in error_log to the effect that a signal has been received? Sure, but I don't think that would help me do what I want. What I meant was you could perhaps find the place

Re: How to recognize server shutdown?

2001-01-10 Thread Stas Bekman
On Wed, 10 Jan 2001, Dave Rolsky wrote: On Wed, 10 Jan 2001, G.W. Haywood wrote: Don't you get a message in error_log to the effect that a signal has been received? Sure, but I don't think that would help me do what I want. Let me illustrate: 1. server is started 2. config is

Re: How to recognize server shutdown?

2001-01-10 Thread Dave Rolsky
On Wed, 10 Jan 2001, Stas Bekman wrote: All we need is to add a $Apache::Server::Quitting or alike, in addition to the existing $Apache::Server::Starting and $Apache::Server::ReStarting, should be an easy patch in XS. I'm not much of an C coder (much less XS) but maybe I'll poke around a

Re: How to recognize server shutdown?

2001-01-10 Thread Perrin Harkins
On Wed, 10 Jan 2001, Dave Rolsky wrote: Is there any way to distinguish between a child being shutdown (say maxrequests has been exceeded) versus all of Apache going down (kill signal sent to the original process or something). Register an END block in your startup.pl, and have it check it's

Re: How to recognize server shutdown?

2001-01-10 Thread Stas Bekman
On Wed, 10 Jan 2001, Perrin Harkins wrote: On Wed, 10 Jan 2001, Dave Rolsky wrote: Is there any way to distinguish between a child being shutdown (say maxrequests has been exceeded) versus all of Apache going down (kill signal sent to the original process or something). Register an END

Re: How to recognize server shutdown?

2001-01-10 Thread Randal L. Schwartz
"Stas" == Stas Bekman [EMAIL PROTECTED] writes: Stas On Wed, 10 Jan 2001, Perrin Harkins wrote: On Wed, 10 Jan 2001, Dave Rolsky wrote: Is there any way to distinguish between a child being shutdown (say maxrequests has been exceeded) versus all of Apache going down (kill signal sent to

Re: How to recognize server shutdown?

2001-01-10 Thread Perrin Harkins
On Thu, 11 Jan 2001, Stas Bekman wrote: the parent process doesn't run the END block. Randal's solution is probably better, but it's a bummer that the parent doesn't run END blocks. Will it run cleanup handlers? - Perrin

Re: How to recognize server shutdown?

2001-01-10 Thread Dave Rolsky
On Wed, 10 Jan 2001, Perrin Harkins wrote: Randal's solution is probably better, but it's a bummer that the parent doesn't run END blocks. Will it run cleanup handlers? I'm pretty sure the parent runs END blocks. I just didn't want to have the cleanup code run during child shutdown. What

How to recognize server shutdown?

2001-01-09 Thread Dave Rolsky
Is there any way to distinguish between a child being shutdown (say maxrequests has been exceeded) versus all of Apache going down (kill signal sent to the original process or something). The reason I ask is that while I can do: BEGIN { # make a file } I can't do: END { # delete a