Hooks for httpd start/stop

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Hooks for httpd start/stop

Jaspreet Singh-2
Hi,

I am writing module which intercepts errorlogs. It forks and execs an
executable and then pipes all the intercepted logs to it.

I open this pipe (and do a fork+exec) in ap_hook_post_config hook. Could
someone suggest me a hook where i can close the pipe and kill the forked
process.

Write now .. i am thinking of using `apr_pool_cleanup_register`. I may
sound foolish .. but is the pool associated with child or httpd (server
as a whole.. i mean the listening process.). Below is the extract from
apr_pools.h .. and i am not sure whether "plain_cleanup" and
"child_cleanup" are called for each child of once for httpd stop/start.

/**
 * Register a function to be called when a pool is cleared or destroyed
 * @param p The pool register the cleanup with
 * @param data The data to pass to the cleanup function.
 * @param plain_cleanup The function to call when the pool is cleared
 *                      or destroyed
 * @param child_cleanup The function to call when a child process is
being shutdown - this function is called in the child, obviously!
 */
APR_DECLARE(void) apr_pool_cleanup_register(
    apr_pool_t *p,
    const void *data,
    apr_status_t (*plain_cleanup)(void *),
    apr_status_t (*child_cleanup)(void *));


Regards,
Jaspreet





--

Don't Walk as if you own the world,
      Walk as if you don't give a damn who owns it.

Jaspreet Singh
Software Engineer,
Ensim India.
[hidden email]
+91 9890712226


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Hooks for httpd start/stop

iro2
?? ?????? ???? ???? ????? ?? ??"?

????
----- Original Message -----
From: "Jaspreet Singh" <[hidden email]>
To: "Apache Modules List" <[hidden email]>
Sent: Tuesday, May 31, 2005 9:32 AM
Subject: [apache-modules] Hooks for httpd start/stop


> Hi,
>
> I am writing module which intercepts errorlogs. It forks and execs an
> executable and then pipes all the intercepted logs to it.
>
> I open this pipe (and do a fork+exec) in ap_hook_post_config hook. Could
> someone suggest me a hook where i can close the pipe and kill the forked
> process.
>
> Write now .. i am thinking of using `apr_pool_cleanup_register`. I may
> sound foolish .. but is the pool associated with child or httpd (server
> as a whole.. i mean the listening process.). Below is the extract from
> apr_pools.h .. and i am not sure whether "plain_cleanup" and
> "child_cleanup" are called for each child of once for httpd stop/start.
>
> /**
>  * Register a function to be called when a pool is cleared or destroyed
>  * @param p The pool register the cleanup with
>  * @param data The data to pass to the cleanup function.
>  * @param plain_cleanup The function to call when the pool is cleared
>  *                      or destroyed
>  * @param child_cleanup The function to call when a child process is
> being shutdown - this function is called in the child, obviously!
>  */
> APR_DECLARE(void) apr_pool_cleanup_register(
>     apr_pool_t *p,
>     const void *data,
>     apr_status_t (*plain_cleanup)(void *),
>     apr_status_t (*child_cleanup)(void *));
>
>
> Regards,
> Jaspreet
>
>
>
>
>
> --
>
> Don't Walk as if you own the world,
>       Walk as if you don't give a damn who owns it.
>
> Jaspreet Singh
> Software Engineer,
> Ensim India.
> [hidden email]
> +91 9890712226
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]