Subject: Re: re-reading /etc/resolv.conf on change
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Greg A. Woods <woods@weird.com>
List: tech-userlevel
Date: 01/02/2004 21:33:15
[ On Saturday, January 3, 2004 at 02:47:09 (+0100), Manuel Bouyer wrote: ]
> Subject: Re: re-reading /etc/resolv.conf on change
>
> You forgot from where this thread started. I hacked on this because I was
> annoyed by the behavior when I switched from linux netscape4 (which manages to
> reread resolv.conf is a way or another) to native mozilla.

Well, no, I didn't forget.

I've simply been focusing on the intermediate points others have raised.

netscape4 undoutably just called res_init() to reload /etc/resolv.conf,
though I've no idea how it decided when to do so.

I've you've taken any time to investigate this issue with mozilla I
think you'll find many patches and suggestions for fixing it.  None of
them involve modifying the resolver library itself.  Some use the silly
hack of turning of the internal RES_INIT flag before _every_ call to a
high-level function such as gethostbyname(), which will of course cause
that function to call res_init() again; and some of them hope to rely on
glibc specific features.  They should just use res_init() in a timely
fashion, but they have, or at least had, some serious concurrency bugs
in their threading model and were not restricting DNS lookups to a
single thread.

The related problems with Mozilla include (but are most certainly _not_
limited to):  (a) its developers are far too enamoured with glibc; and
(b) it's developers are not really well trained in writing safe and
reliable threaded applications.

Regardless hacking the resolver code in some vain attempt to solve this
problem for the application is still the wrong solution.

The best solution for you for now really is to run your own caching
daemon since after all you're not afraid of large-footprint programs if
you're already running Mozilla.


> A web browser don't react the way you descrive to SIGHUP, and I don't expect
> it to. For such a software, exiting gracefully on SIGUP is probably the right
> thing.

You're also focusing on the wrong thing.  SIGHUP is _only_ an _example_!!!!

(Even if you started your mozilla from /etc/rc, using "/etc/rc.d/mozilla
reload" wouldn't necessarily send it a SIGHUP now, would it?  Or maybe
it should!  That might get the point across!  ;-))

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>