Subject: Re: re-reading /etc/resolv.conf on change
To: Perry E. Metzger <perry@piermont.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-userlevel
Date: 12/31/2003 15:58:42
On Tue, Dec 30, 2003 at 09:46:07AM -0500, Perry E. Metzger wrote:
> 
> Martin Husemann <martin@duskware.de> writes:
> > How about stat'ing /etc/resolv.conf, opening the kqueue on it *and* /etc
> > always and checking the stat values on every kqueue event? 
> >
> > Seems like that way all failure modes discussed so far could be easily
> > detected.
> 
> resolv.conf is symlinked to /etc/sites/foo/resolv.conf
> 
> someone does an mv /etc/sites/foo/resolv.conf to
> /etc/sites/foo/resolv.conf.new and then creates a new
> /etc/sites/foo/resolv.conf
> 
> I don't think that would be detected.

It would with kqueue, because it will monitor /etc/sites/foo/resolv.conf (open
follows the symlink) and a rename is a one of the events monitored.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 23 ans d'experience feront toujours la difference
--