httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: API for detecting first config run
Date Fri, 12 Nov 2010 20:16:52 GMT
On Fri, Nov 12, 2010 at 2:59 PM, William A. Rowe Jr.
<> wrote:
> On 11/12/2010 12:47 PM, Stefan Fritsch wrote:
>> Hi,
>> it is common procedure for modules to detect the first configuration
>> run at httpd startup by looking for some userdata in the process pool.
>> If the userdata is not set, they set it and then skip some
>> initialization that should not be done during the first config run.
>> But this logic is broken: If a LoadModule statement is added while
>> httpd is running, and httpd is then gracefully restarted, the module
>> will be loaded but assume that this is the startup configuration
>> phase. It won't initialize itself fully and will work correctly only
>> after the second graceful restart. This can be very confusing for
>> users.
> That's why you would generally add a pool datum to the process->pool,
> which survives module unload/reload.

see also ap_retained_data_{create|get} which hides the pool trick; but
Stefan is getting at a specific question that the module wants to ask
so that it can potentially work if added across restart

which questions should modules be able to ask?

last-load/init-before-activation?          (seems to work for most purposes)
pre-detach-load/init?     (never seen when added during restart)
(not to mention weird Windows stuff -- is this the parent or the
child, and which pass)

should pre-config and post-config just get an indicator?

View raw message