Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 31898 invoked from network); 1 Dec 2006 09:24:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Dec 2006 09:24:57 -0000 Received: (qmail 48366 invoked by uid 500); 1 Dec 2006 09:25:06 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 48171 invoked by uid 500); 1 Dec 2006 09:25:05 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 48162 invoked by uid 99); 1 Dec 2006 09:25:05 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 01:25:05 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [80.229.52.226] (HELO grimnir.webthing.com) (80.229.52.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 01:24:54 -0800 Received: from grimnir.webthing.com (localhost [127.0.0.1]) by grimnir.webthing.com (Postfix) with ESMTP id 47B8D2136 for ; Fri, 1 Dec 2006 09:24:32 +0000 (GMT) Date: Fri, 1 Dec 2006 09:24:31 +0000 From: Nick Kew To: modules-dev@httpd.apache.org Subject: Re: Invocation of any Handler before Apache's shutdown Message-ID: <20061201092431.1d4125a6@grimnir> In-Reply-To: <68e2e43e0611302332o752705e1x7609303dd3c6d7ec@mail.gmail.com> References: <68e2e43e0611302332o752705e1x7609303dd3c6d7ec@mail.gmail.com> Organization: WebThing X-Mailer: Sylpheed-Claws 2.5.0-rc3 (GTK+ 2.10.6; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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 > WINDOWS. 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 (see http://people.apache.org/~trawick/). > 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 http://www.apachetutor.org/