You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "William A. Rowe, Jr." <wr...@rowe-clan.net> on 2001/11/10 07:32:32 UTC

Something I learned, today

If one adds a module multiple times, (in this case, the silly user just
commented out the ClearModuleList) there is no warning whatsoever, yet
it causes (obviously) no end of chaos and unpredictable failures.  This
especially impacts upgraders who foolishly copy configs from one install
to another.

If someone wants a little hack to write, take the LoadModule (and on 1.3,
AddModule) and actually _test_ to see if that module is yet loaded :)

Bill




Re: Something I learned, today

Posted by "William A. Rowe, Jr." <wr...@covalent.net>.
From: "Brian Pane" <bp...@pacbell.net>
Sent: Saturday, November 10, 2001 1:21 AM


> William A. Rowe, Jr. wrote:
> 
> >If one adds a module multiple times, (in this case, the silly user just
> >commented out the ClearModuleList) there is no warning whatsoever, yet
> >it causes (obviously) no end of chaos and unpredictable failures.  This
> >especially impacts upgraders who foolishly copy configs from one install
> >to another.
> >
> >If someone wants a little hack to write, take the LoadModule (and on 1.3,
> >AddModule) and actually _test_ to see if that module is yet loaded :)
> >
> 
> It looks like the check to prevent multiple loading is already there,
> at least in 2.0.  Here's a warning message to go along with it, though:

Yes... was there.  Thanks for the patch Brian, I retrofitted it to 1.3 as
well, since that's where the bug report originated, and it was more complicated!
But since things like mod_jk might be set it an included conf and the main conf,
this was still a worthwhile excersize.

Bill


Re: Something I learned, today

Posted by Ian Holsman <ia...@cnet.com>.
On 11/9/01 11:21 PM, "Brian Pane" <bp...@pacbell.net> wrote:

Commited..
Thanks Brian
> -        if (modi->name != NULL && strcmp(modi->name, modname) == 0)
> +        if (modi->name != NULL && strcmp(modi->name, modname) == 0) {
> +            ap_log_perror(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0,
> +                          cmd->pool, "module %s is already loaded,
> skipping",
> +                          modname);
>            return NULL;
> +        }


Re: Something I learned, today

Posted by Brian Pane <bp...@pacbell.net>.
William A. Rowe, Jr. wrote:

>If one adds a module multiple times, (in this case, the silly user just
>commented out the ClearModuleList) there is no warning whatsoever, yet
>it causes (obviously) no end of chaos and unpredictable failures.  This
>especially impacts upgraders who foolishly copy configs from one install
>to another.
>
>If someone wants a little hack to write, take the LoadModule (and on 1.3,
>AddModule) and actually _test_ to see if that module is yet loaded :)
>

It looks like the check to prevent multiple loading is already there,
at least in 2.0.  Here's a warning message to go along with it, though:

Index: modules/mappers/mod_so.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/mappers/mod_so.c,v
retrieving revision 1.44
diff -u -r1.44 mod_so.c
--- modules/mappers/mod_so.c    2001/10/16 19:04:02    1.44
+++ modules/mappers/mod_so.c    2001/11/10 07:10:18
@@ -221,8 +221,12 @@
     modie = (moduleinfo *)sconf->loaded_modules->elts;
     for (i = 0; i < sconf->loaded_modules->nelts; i++) {
         modi = &modie[i];
-        if (modi->name != NULL && strcmp(modi->name, modname) == 0)
+        if (modi->name != NULL && strcmp(modi->name, modname) == 0) {
+            ap_log_perror(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0,
+                          cmd->pool, "module %s is already loaded, 
skipping",
+                          modname);
             return NULL;
+        }
     }
     modi = apr_array_push(sconf->loaded_modules);
     modi->name = modname;