Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Dev

server start-up/shutdown hooks?

 

 

Apache dev RSS feed   Index | Next | Previous | View Threaded


rasmus at bellglobal

Jun 13, 1997, 8:01 AM

Post #1 of 2 (516 views)
Permalink
server start-up/shutdown hooks?

I am playing around with the idea of allowing a PHP script to be run
whenever an httpd process starts up, have it use permanent_pool to
store a super global stack frame which will then be accessible from the
pre-request PHP scripts. And when the httpd exits I want to be able to
call a cleanup PHP script.

The main motivator for something like this is to be able to open up a
connection to an RDBMS from each httpd and have it remain open for the
life of the httpd process. However, the mechanism would also be useful
for all sorts of other things.

I think I can get the startup stuff to work by putting in a server_config
handler in mod_php, but looking in http_main.c I don't see how I can get
a hook in to do something just before an httpd process exits. Any ideas,
or will this end up as a wish list item for 2.0?

-Rasmus


dgaudet at arctic

Jun 13, 1997, 9:59 AM

Post #2 of 2 (494 views)
Permalink
Re: server start-up/shutdown hooks? [In reply to]

We had an oracle guy request this too... both ben and I said "but what
about abnormal shutdowns?" Children are killed off by restarts, and by my
new code that sends USR1 to keep it within the MaxSpareServer setting.
We'd need to revamp that code at least to not just exit() on receiving
those signals.

So you can wish list it, but it's not a perfect thing.

Dean

On Fri, 13 Jun 1997 rasmus [at] bellglobal wrote:

> I am playing around with the idea of allowing a PHP script to be run
> whenever an httpd process starts up, have it use permanent_pool to
> store a super global stack frame which will then be accessible from the
> pre-request PHP scripts. And when the httpd exits I want to be able to
> call a cleanup PHP script.
>
> The main motivator for something like this is to be able to open up a
> connection to an RDBMS from each httpd and have it remain open for the
> life of the httpd process. However, the mechanism would also be useful
> for all sorts of other things.
>
> I think I can get the startup stuff to work by putting in a server_config
> handler in mod_php, but looking in http_main.c I don't see how I can get
> a hook in to do something just before an httpd process exits. Any ideas,
> or will this end up as a wish list item for 2.0?
>
> -Rasmus
>

Apache dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.