httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <>
Subject Re: read_config()
Date Mon, 22 Jul 1996 21:26:05 GMT

Thanks Robert,

To expand on how I discovered it...

An invalid DocumentRoot in a VirtualHost directive will complain
twice. I was debugging this new recursive IncludeConf directive
that I brought up the other day and was sure it was my code...

>   Why are there two calls to read_config()?
> As with the "multiple config files" question, this comes up often
> enough to merit inclusion in a FAQ someplace... on the other hand, it
> generally comes up in a slightly different form (the most common
> being, "why is my module's init routine called twice?").
> What's going on is that the server calls read_config():
>   *) At startup, to determine whether it is running under inetd
>   *) Every time it begins standalone operations, either on intial
>      startup or on a signal-triggered restart.  
> The second call could be avoided on initial entry to standalone_main(),
> of course --- but it would complicate the code a bit to do so.  A more
> subtle point is that with that second call in place, it becomes much
> harder to write a module which can't handle a restart, since it has 
> to handle the implicit restart on entry to standalone_main() in order
> to work at all.
> Since SIGHUP survival testing isn't necessarily the first (or
> fiftieth) thing on peoples' minds when they're writing these things, I
> suspect a lot of people wouldn't bother at all unless something came
> along to force the issue.  Since this question is most often asked by
> people whose code, as it turns out, is failing because of the second
> call (and which therefore wouldn't, in fact, function correctly on a
> signal-triggered restart), this bit of fortuitous torture testing may
> in fact have improved at least some of the modules out there...
> rst

View raw message