You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Igor Tatarinov <ta...@prairie.NoDak.edu> on 1997/12/08 04:21:59 UTC

How to do cleanup only once per module?

I was wondering if there is a simple way to ensure that a cleanup function
is not executed by children.
Say, I have an mmapped segment and I want only the main process to know
that it should be cleaned (unmapped). When I register my cleanup function
with pconf all children inherit it and call it :(

any ideas?

thanks,
igor

Re: How to do cleanup only once per module?

Posted by Dean Gaudet <dg...@arctic.org>.
A cleanup registered in the pool given to your init() function will be
performed once (per restart/shutdown), in the parent (this is pconf, in
http_main lingo).  A cleanup registered in the pool given to your
init_child() function will be performed once per child (exit).

If that's not what you're seeing then something is broken.  You need a
recent code drop though, this was fixed during 1.3b3-dev, like two weeks
ago. 

Dean

On Sun, 7 Dec 1997, Igor Tatarinov wrote:

> I was wondering if there is a simple way to ensure that a cleanup function
> is not executed by children.
> Say, I have an mmapped segment and I want only the main process to know
> that it should be cleaned (unmapped). When I register my cleanup function
> with pconf all children inherit it and call it :(
> 
> any ideas?
> 
> thanks,
> igor
>