You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Bryan McQuade <bm...@google.com> on 2010/11/12 14:21:51 UTC
Server reloads
Hi. I have read the docs but I have a few questions regarding server
reloads. Under what conditions will httpd reread its conf file? Will httpd
also reload its shared modules when updating conf files? I am trying to make
sure that updating a conf and corresponding so on disk with a newer version
would not cause problems for a running httpd instance. Are there cases where
it is dangerous to install a newer version of a so and conf file while httpd
is running?
Re: Server reloads
Posted by Bryan McQuade <bm...@google.com>.
thanks!
On Fri, Nov 12, 2010 at 10:06 AM, Jeff Trawick <tr...@gmail.com> wrote:
> On Fri, Nov 12, 2010 at 9:52 AM, Bryan McQuade <bm...@google.com> wrote:
>> Thanks Dennis. I'm wondering what it means for modules to handle
>> reloads correctly. What can/should a shared object do to gracefully
>> reload? What should it not do? Are there specific hooks I should
>> register for in order to handle reloads correctly? And if so, what
>> should my module do in those hooks?
>
> apachectl {graceful|restart} will cause your module to
>
> in the parent process:
> de-init (if you have cleanups registered on pconf), be unloaded, be
> loaded again, be re-initialized (pre-init hook, directive handling,
> post-config hook, etc.).
>
> (and just for giggles, this cycle even repeats during startup)
>
> in the child process:
> run any cleanups registered on pchild
>
> (this is approximate)
>
> look at
>
> server-bundled modules
> server/main.c -- the loop that repeats for every server generation
> (start/restart sequence)
>
>>
>>
>> On Fri, Nov 12, 2010 at 9:40 AM, Dennis Jacobfeuerborn
>> <de...@conversis.de> wrote:
>>> On 11/12/2010 03:04 PM, Tom Evans wrote:
>>>>
>>>> On Fri, Nov 12, 2010 at 1:21 PM, Bryan McQuade<bm...@google.com>
>>>> wrote:
>>>>>
>>>>> Hi. I have read the docs but I have a few questions regarding server
>>>>> reloads. Under what conditions will httpd reread its conf file? Will
>>>>> httpd
>>>>> also reload its shared modules when updating conf files? I am trying to
>>>>> make
>>>>> sure that updating a conf and corresponding so on disk with a newer
>>>>> version
>>>>> would not cause problems for a running httpd instance. Are there cases
>>>>> where
>>>>> it is dangerous to install a newer version of a so and conf file while
>>>>> httpd
>>>>> is running?
>>>>
>>>> The conf files will only be re-read on a graceful restart (or sending
>>>> SIGUSR1 to the parent process, which is the same thing).
>>>>
>>>> You may want to verify this with others (or by a simple test), but
>>>> iirc anything loaded with LoadModule or LoadFile is reloaded at the
>>>> same time.
>>>
>>> I've had problems at times where when I installed an additional php
>>> extension and greacefully restarted Apache mod_php stoppen working properly.
>>> This is most likely a problem of mod_php and not Apache but you might take
>>> it into consideration that while Apache might reload it's modules these
>>> modules might not handle this properly.
>>>
>>> Regards,
>>> Dennis
>>>
>>
>
>
>
> --
> Born in Roswell... married an alien...
>
Re: Server reloads
Posted by Jeff Trawick <tr...@gmail.com>.
On Fri, Nov 12, 2010 at 9:52 AM, Bryan McQuade <bm...@google.com> wrote:
> Thanks Dennis. I'm wondering what it means for modules to handle
> reloads correctly. What can/should a shared object do to gracefully
> reload? What should it not do? Are there specific hooks I should
> register for in order to handle reloads correctly? And if so, what
> should my module do in those hooks?
apachectl {graceful|restart} will cause your module to
in the parent process:
de-init (if you have cleanups registered on pconf), be unloaded, be
loaded again, be re-initialized (pre-init hook, directive handling,
post-config hook, etc.).
(and just for giggles, this cycle even repeats during startup)
in the child process:
run any cleanups registered on pchild
(this is approximate)
look at
server-bundled modules
server/main.c -- the loop that repeats for every server generation
(start/restart sequence)
>
>
> On Fri, Nov 12, 2010 at 9:40 AM, Dennis Jacobfeuerborn
> <de...@conversis.de> wrote:
>> On 11/12/2010 03:04 PM, Tom Evans wrote:
>>>
>>> On Fri, Nov 12, 2010 at 1:21 PM, Bryan McQuade<bm...@google.com>
>>> wrote:
>>>>
>>>> Hi. I have read the docs but I have a few questions regarding server
>>>> reloads. Under what conditions will httpd reread its conf file? Will
>>>> httpd
>>>> also reload its shared modules when updating conf files? I am trying to
>>>> make
>>>> sure that updating a conf and corresponding so on disk with a newer
>>>> version
>>>> would not cause problems for a running httpd instance. Are there cases
>>>> where
>>>> it is dangerous to install a newer version of a so and conf file while
>>>> httpd
>>>> is running?
>>>
>>> The conf files will only be re-read on a graceful restart (or sending
>>> SIGUSR1 to the parent process, which is the same thing).
>>>
>>> You may want to verify this with others (or by a simple test), but
>>> iirc anything loaded with LoadModule or LoadFile is reloaded at the
>>> same time.
>>
>> I've had problems at times where when I installed an additional php
>> extension and greacefully restarted Apache mod_php stoppen working properly.
>> This is most likely a problem of mod_php and not Apache but you might take
>> it into consideration that while Apache might reload it's modules these
>> modules might not handle this properly.
>>
>> Regards,
>> Dennis
>>
>
--
Born in Roswell... married an alien...
Re: Server reloads
Posted by Bryan McQuade <bm...@google.com>.
Thanks Dennis. I'm wondering what it means for modules to handle
reloads correctly. What can/should a shared object do to gracefully
reload? What should it not do? Are there specific hooks I should
register for in order to handle reloads correctly? And if so, what
should my module do in those hooks?
On Fri, Nov 12, 2010 at 9:40 AM, Dennis Jacobfeuerborn
<de...@conversis.de> wrote:
> On 11/12/2010 03:04 PM, Tom Evans wrote:
>>
>> On Fri, Nov 12, 2010 at 1:21 PM, Bryan McQuade<bm...@google.com>
>> wrote:
>>>
>>> Hi. I have read the docs but I have a few questions regarding server
>>> reloads. Under what conditions will httpd reread its conf file? Will
>>> httpd
>>> also reload its shared modules when updating conf files? I am trying to
>>> make
>>> sure that updating a conf and corresponding so on disk with a newer
>>> version
>>> would not cause problems for a running httpd instance. Are there cases
>>> where
>>> it is dangerous to install a newer version of a so and conf file while
>>> httpd
>>> is running?
>>
>> The conf files will only be re-read on a graceful restart (or sending
>> SIGUSR1 to the parent process, which is the same thing).
>>
>> You may want to verify this with others (or by a simple test), but
>> iirc anything loaded with LoadModule or LoadFile is reloaded at the
>> same time.
>
> I've had problems at times where when I installed an additional php
> extension and greacefully restarted Apache mod_php stoppen working properly.
> This is most likely a problem of mod_php and not Apache but you might take
> it into consideration that while Apache might reload it's modules these
> modules might not handle this properly.
>
> Regards,
> Dennis
>
Re: Server reloads
Posted by Dennis Jacobfeuerborn <de...@conversis.de>.
On 11/12/2010 03:04 PM, Tom Evans wrote:
> On Fri, Nov 12, 2010 at 1:21 PM, Bryan McQuade<bm...@google.com> wrote:
>> Hi. I have read the docs but I have a few questions regarding server
>> reloads. Under what conditions will httpd reread its conf file? Will httpd
>> also reload its shared modules when updating conf files? I am trying to make
>> sure that updating a conf and corresponding so on disk with a newer version
>> would not cause problems for a running httpd instance. Are there cases where
>> it is dangerous to install a newer version of a so and conf file while httpd
>> is running?
>
> The conf files will only be re-read on a graceful restart (or sending
> SIGUSR1 to the parent process, which is the same thing).
>
> You may want to verify this with others (or by a simple test), but
> iirc anything loaded with LoadModule or LoadFile is reloaded at the
> same time.
I've had problems at times where when I installed an additional php
extension and greacefully restarted Apache mod_php stoppen working
properly. This is most likely a problem of mod_php and not Apache but you
might take it into consideration that while Apache might reload it's
modules these modules might not handle this properly.
Regards,
Dennis
Re: Server reloads
Posted by Tom Evans <te...@googlemail.com>.
On Fri, Nov 12, 2010 at 1:21 PM, Bryan McQuade <bm...@google.com> wrote:
> Hi. I have read the docs but I have a few questions regarding server
> reloads. Under what conditions will httpd reread its conf file? Will httpd
> also reload its shared modules when updating conf files? I am trying to make
> sure that updating a conf and corresponding so on disk with a newer version
> would not cause problems for a running httpd instance. Are there cases where
> it is dangerous to install a newer version of a so and conf file while httpd
> is running?
The conf files will only be re-read on a graceful restart (or sending
SIGUSR1 to the parent process, which is the same thing).
You may want to verify this with others (or by a simple test), but
iirc anything loaded with LoadModule or LoadFile is reloaded at the
same time.
Cheers
Tom