You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Jaysingh Samuel <ja...@hotmail.com> on 2009/04/20 05:58:05 UTC
RE: Deregister and register a single module on passing signal..
Hai all,
Can anyBody help me out with some solution on this.
Thanks,
Jaysingh Samuel
From: jayasingh.samuel@hotmail.com
To: modules-dev@httpd.apache.org; sorinm@gmail.com
Subject: Deregister and register a signal module on passing signal..
Date: Thu, 16 Apr 2009 09:31:28 +0530
Hai,
I have apache server running with apache Modules and few custom Modules. When i looked into the server module code, i could see that when the parent process receives a graceful signal then it deregisters all the modules and then registers it and run a post config of the modules to load it again and then spawns new Childrens.
The following are the my concerns and wanted to know if its possible to do.
1. If iam passing a SigUSR2 signal to the parent process, then will i be able to reload/rerun only my custom Modules, without reading the config file ?.
Thanks in advance,
Jaysingh Samuel.
The new Windows Live Messenger. You don’t want to miss this.
_________________________________________________________________
How fun is this? IMing with Windows Live Messenger just got better.
http://www.microsoft.com/india/windows/windowslive/messenger.aspx
Re: Deregister and register a single module on passing signal..
Posted by Saju Pillai <sa...@gmail.com>.
Jaysingh Samuel wrote:
> Eric,
> Thanks for your reply, let me make my question clear..
> I have one Custom module, which i want to reload every 10mins, when i give graceful then it reloads all the modules and also the config directives. Because of this i want to have an option in the httpd say "reloadcustom" which takes signal Sigusr2 and have to reload only the custom modules i have without reading the config Directives and should gracefully start the apache.
> The only difference between the graceful and my reloadcustom should be that the reloadcustom will have to reload only custom modules without reading the config directives.
> I tried to do this by directly calling the post_config on my custom_module in the worker.c after getting the reloadcustom signal but i see memory Leaks because of this, the following are the sample code.
>
> Worker.cstatic void server_main_loop(int remaining_children_to_start){ int child_slot; apr_exit_why_e exitwhy; int status, processed_status; apr_proc_t pid; int i; while (!restart_pending && !shutdown_pending) { /* Parent process childen to finish up and spawns new children. */ if (is_reload == 1) { Here i called my custom_module post config function. /* wake up the children...time to die.*/ ap_mpm_pod_killpg(pod, ap_daemons_limit, TRUE); is_reload = 0; } ap_wait_or_timeout(&exitwhy, &status, &pid, pconf);}
> Please let me your suggestion on this.
> Thanks in advance, Jaysingh Samuel.
>
httpd does not support what you are trying to do. Maybe what you really
want is a FastCGI style process that can manage it's lifecycle
independent of apache ?
-srp
RE: Deregister and register a single module on passing signal..
Posted by Jaysingh Samuel <ja...@hotmail.com>.
Eric,
Thanks for your reply, let me make my question clear..
I have one Custom module, which i want to reload every 10mins, when i give graceful then it reloads all the modules and also the config directives. Because of this i want to have an option in the httpd say "reloadcustom" which takes signal Sigusr2 and have to reload only the custom modules i have without reading the config Directives and should gracefully start the apache.
The only difference between the graceful and my reloadcustom should be that the reloadcustom will have to reload only custom modules without reading the config directives.
I tried to do this by directly calling the post_config on my custom_module in the worker.c after getting the reloadcustom signal but i see memory Leaks because of this, the following are the sample code.
Worker.cstatic void server_main_loop(int remaining_children_to_start){ int child_slot; apr_exit_why_e exitwhy; int status, processed_status; apr_proc_t pid; int i; while (!restart_pending && !shutdown_pending) { /* Parent process childen to finish up and spawns new children. */ if (is_reload == 1) { Here i called my custom_module post config function. /* wake up the children...time to die.*/ ap_mpm_pod_killpg(pod, ap_daemons_limit, TRUE); is_reload = 0; } ap_wait_or_timeout(&exitwhy, &status, &pid, pconf);}
Please let me your suggestion on this.
Thanks in advance, Jaysingh Samuel.
> Date: Mon, 20 Apr 2009 09:21:58 -0400
> Subject: Re: Deregister and register a single module on passing signal..
> From: covener@gmail.com
> To: modules-dev@httpd.apache.org
>
> On Sun, Apr 19, 2009 at 11:58 PM, Jaysingh Samuel
> <ja...@hotmail.com> wrote:
>
>> 1. If iam passing a SigUSR2 signal to the parent process, then will i be able to reload/rerun only my custom Modules, without reading the config file ?.
>
> No, all the modules are reloaded and the config is re-parsed.
>
> --
> Eric Covener
> covener@gmail.com
_________________________________________________________________
The new Windows Live Messenger. You don’t want to miss this.
http://www.microsoft.com/india/windows/windowslive/messenger.aspx
Re: Deregister and register a single module on passing signal..
Posted by Eric Covener <co...@gmail.com>.
On Sun, Apr 19, 2009 at 11:58 PM, Jaysingh Samuel
<ja...@hotmail.com> wrote:
> 1. If iam passing a SigUSR2 signal to the parent process, then will i be able to reload/rerun only my custom Modules, without reading the config file ?.
No, all the modules are reloaded and the config is re-parsed.
--
Eric Covener
covener@gmail.com