httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <>
Subject Re: Invocation of any Handler before Apache's shutdown
Date Fri, 01 Dec 2006 09:24:31 GMT
On Fri, 1 Dec 2006 13:02:14 +0530
shahid <> wrote:

> Hi,
> I am a newbie.
> I am writing a new module for starting/shuttingdown a process(which is
> dependent on Apache)  when Apache is starting/shutting down in

In general, modules are not platform-specific (except MPMs).

Corollary: if yours is, that could indicate that it shouldn't really
be a module.

(there are exceptions to this rule: treat "Module for [platform]"
as a Warning but not an Error).

> I am able to do startup/shutdown by using ap_hook_child_init ,
> apr_pool_cleanup_register.

child_init happens after apache has forked child processes.

Corollary: it's really for internal initialisation.  If you use
it for external things like starting a process, you have to worry
about how many instances of your process get started.

A pre_config or post_config hook would avoid this issue.

> apr_pool_cleanup_register is getting called after  httpd is down. But

No, your cleanup is part of the shutdown process.  Neither before
nor after shutdown.

> my requirement is it needs to be called before the shutdown of Apache.

I think you're looking to wrap apache from outside, rather than write
a module.  But if you really want a module, take a look at Jeff
Trawick's introspection modules as a startingpoint

> Is there any handler to do it? If not , is there any other way?
> I need to know the Apache installed PATH , is there any environmental
> variable set which contains the apache path?

Sounds like SERVER_ROOT.

Nick Kew

Application Development with Apache - the Apache Modules Book

View raw message