httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sutton <>
Subject Shared module unloading
Date Fri, 12 Dec 1997 14:48:07 GMT
We load modules dynamically on Win32 - and have the capability to do this
on Unix as well - we we completely ingnore changes to the LoadModule lines
when we do a restart. So if the user edits (adds/removes) LoadModules and
does a restart, they won't get the new modules and Apache doesn't remove
the ones they've removed (and if they changed the order of the
LoadModules, Apache doesn't see that either). This certainly ought to be
logged (say "LoadModule ignored on restart for module XXXX").

But why don't we make LoadModule work on restarts? I've been playing with
this on Win32. Here is the plan:

  - add the loaded modules handle to the "module" struct (so we can unload

  - when it is loaded, store the module's module struct address as a
    cleanup in the pconf pool

  - add a cleanup routine for loaded modules: when pconf is cleaned,
    this gets called and unloads the module, removing it from the
    linked list of modules

So when the parent gets a restart, it cleans the pconf pool which unloads
the modules, then run through read_config() again which loads the
(possibly different) modules.

I *think* this should all work. When we remove modules from the linked
list of modules, all the per-dir and per-server vectors will be invalid,
but they will be cleaned as part of the pconf cleanup anyway. As long as
they aren't ever used once the pool cleanup has started. pconf should
only ever be cleaned when a restart is happening (or just before
exitting). Can anyone see any problems with doing it this way?

An alternative would be to have an explict unload_dynamic_modules function
which is called during a restart, which unloads modules from the module
linked list. 


View raw message