Re: Help: How to call function on Apache quitA

2008-01-09 Thread Erik Lotspeich
Hi Nick,

I continued some testing and it seems that the pool cleanup mechanism does not 
work.  Here's my cleanup register call:

apr_pool_cleanup_register(s-process-pool, mydata, proc_cleanup,
  apr_pool_cleanup_null);

My cleanup function, proc_cleanup() never gets called when I quit Apache.

Is there something else that I can do?

Regards,

Erik.

On Thursday 15 November 2007 02:22, Nick Kew wrote:
 On Thu, 15 Nov 2007 00:15:17 -0800 (PST)

 Erik Lotspeich [EMAIL PROTECTED] wrote:
  The basic question is: how to execute code when Apache quits.

 Register a cleanup function on the process pool.


Re: Help: How to call function on Apache quit

2008-01-09 Thread Erik Lotspeich

Hi William,

Thanks for your response.


Your *loadable* module doesn't survive to the end of the proc pool
because it's codepages were already unloaded.  Be careful.


So is there a way for a dynamically-loadable module to do any teardown 
when Apache quits?  It seems that there must be some signal, API, or 
mechanism.


Thanks,

Erik.


Re: Help: How to call function on Apache quitA

2007-11-15 Thread Erik Lotspeich

Hi Nick,

Thank you for your response.

I tried this approach initially.  I may have been using it incorrectly, 
however.  What I tried was setting up the cleanup function with the 
process pool itself as data.  The reason for this is that I wanted to 
retrieve some data via apr_pool_userdata_get() in order to do the 
necessary cleanup.  This didn't work -- is it possible that the pool is 
already partial destroyed when the cleanup function is called?  I 
noticed that the Apache logging facilities don't appear to work in the 
cleanup function either.


I am also curious why apr_pool_note_subprocesses() does not appear to 
work.  This function seems ideal for my purpose; am I using it 
incorrectly?


Your book is excellent, by the way.  Having a clearly-written definitive 
resource has saved me countless hours.


Regards,

Erik.

On Thu, 15 Nov 2007, Nick Kew wrote:


On Thu, 15 Nov 2007 00:15:17 -0800 (PST)
Erik Lotspeich [EMAIL PROTECTED] wrote:


The basic question is: how to execute code when Apache quits.


Register a cleanup function on the process pool.