Return-Path: X-Original-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3C5EA6BE1 for ; Mon, 20 Jun 2011 20:10:46 +0000 (UTC) Received: (qmail 9626 invoked by uid 500); 20 Jun 2011 20:10:45 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 9525 invoked by uid 500); 20 Jun 2011 20:10:45 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 9517 invoked by uid 99); 20 Jun 2011 20:10:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2011 20:10:45 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.125.83.45] (HELO mail-gw0-f45.google.com) (74.125.83.45) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2011 20:10:40 +0000 Received: by gwb19 with SMTP id 19so1325914gwb.18 for ; Mon, 20 Jun 2011 13:10:19 -0700 (PDT) Received: by 10.236.190.73 with SMTP id d49mr4293266yhn.517.1308600617156; Mon, 20 Jun 2011 13:10:17 -0700 (PDT) Received: from bhuda.mired.org (h236.134.89.75.dynamic.ip.windstream.net [75.89.134.236]) by mx.google.com with ESMTPS id g5sm3771618yhm.68.2011.06.20.13.10.16 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Jun 2011 13:10:16 -0700 (PDT) Date: Mon, 20 Jun 2011 16:10:12 -0400 From: Mike Meyer To: modules-dev@httpd.apache.org Cc: jasonlfunk@gmail.com Subject: Re: Module External Configuration Message-ID: <20110620161012.7f893667@bhuda.mired.org> In-Reply-To: References: Organization: Meyer Consulting X-Mailer: Claws Mail 3.7.7 (GTK+ 2.22.1; amd64-portbld-freebsd8.1) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAG1BMVEXguIzRkGnhyaz069mXhW0WHRnbrnR9WCQ6LB0CchNMAAACSUlEQVQ4jV2TQW7jMAxFGaPQOgQEdZaGMsgBrAvUA03dCxj1Uu4U2gfwQD7AGNax51NK07RcxXz6/CSl0Ij450vkPG1jzpIZM1UwDCl/xB14TWnNX8A00Qj5a0mnVFVbVUz4MeErea2HikSRqZzY894zwg9p2+/AtO8LzxFED+tNAUFeU29iFOLRxlZAcdo9A8wi8ZBMV4BKPde82Oxrvs6BTkulQIClte0DLFzzsKk9j1MBex8iUaP00Bd78S/muyFScrTXz6zLkEUxJp+SabQfNOs4f4Jpx5qSZ/304PWwlEWP1cOn/mJQR7EOD+uKhjcBLziuL7xoY5Xm+VFAUSw/LwwwsHEHxihpwV4EJH0xXRkbw1PkRw+X4pEuSJwBggqk+HEYKkiL5/74/nQkogigzQsAFrakxZyfw3wMIEEZPv4AWMfxwqE5GNxGaERjmH+PG8AE0L4/w9g0lsp1raLYAN5azQa+AOoO9NwcpFkTrG2VKNMNEL5UKUUAw34tha0z7onUG0oBoNtczE04GwFE3wCHc0ChezAJ6A1WMV81AtY7wDAJSlXwV+4cwBvsOsrQMRawfQEBz0deEZ7WNpV2szckIKo5VpDHDSDvF1GItwqqAlG01Hh50BGtVhuUkjkasg/14bYFGCgWg1fSWHvmOoJck2xdp9ZvZBHzDVTzX23TkrOn7qe5U2COEw5D4Vx3qEQpFY2Z/3QFnJxzp7YCmSMG19nOUoe869zZfOQb5ywQuWu0yCn5+8gxZz+BE7vG3j4/wbf4D/sXN9Wug1s7AAAAAElFTkSuQmCC Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 20 Jun 2011 13:39:48 -0500 Jason Funk 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. http://www.mired.org/ Independent Software developer/SCM consultant, email for more information. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org