httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Meyer <...@mired.org>
Subject Re: Module External Configuration
Date Mon, 20 Jun 2011 20:10:12 GMT
On Mon, 20 Jun 2011 13:39:48 -0500
Jason Funk <jasonlfunk@gmail.com> wrote:

> Hello,
> 
> The module that I am writing has an external configuration file that it
> parses and loads into configuration when the server loads. Before every
> request it checks to see if the configuration file has been updated and if
> it has it reloads the configuration. The configuration should be shared over
> the entire server. The problem I am running into is that after the
> configuration file is updated the new configuration gets reloaded and stored
> in memory but after a little while, the configuration reverts back to it's
> previous version. I assume that this is because a new process was spawned to
> handle a new request and the updated memory didn't get carried over (even
> though the pointer address didn't change...)
> 
> My question is this: What mechanism should I be using in order to
> store persistent, mutable, configuration data that is shared between every
> child process?

Put the configuration data into shared memory. Create and load the
shared memory in the post config hook. Map the shared memory and
potentially reload it during the child init hook. You'll need to use
appropriate locking if you decide to reload it. Details on the locking
will depend on the data structure details.

    <mike
-- 
Mike Meyer <mwm@mired.org>		http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Mime
View raw message