Subject: Re: re-reading /etc/resolv.conf on change
To: Andrew Brown <atatat@atatdot.net>
From: Perry E. Metzger <perry@piermont.com>
List: tech-userlevel
Date: 12/31/2003 17:19:18
Andrew Brown <atatat@atatdot.net> writes:
> i think that for whatever you can decide to watch, i can invent a
> scheme that will "accidentally" bypass it.  we either need to decide
> what the basic requirements are, or decide that doing:
>
> 	fd = open("/etc/resolv.conf", O_RDONLY);
> 	fstat(fd, &st);
> 	<compare new st_dev/st_ino/st_size/st_mtime/st_ctime with
> 	recorded st_dev/st_ino/st_size/st_mtime/st_ctime>
>
> or something like that.  and then smack a sticker on it saying that we
> done our best.

Another possibility -- maybe we are looking at this wrong? There are a
variety of conditions we might want to inform programs of ("you've
just been awakened after a deep sleep", "the network addresses have
all changed", "your resolv.conf is different"), and perhaps we should
come up with a more general mechanism for telling programs about such
things?

Then, if you alter resolv.conf, run a program announcing "I've altered
resolv.conf" to the world and all will be well! :)

Perry