From owner-freebsd-arch@FreeBSD.ORG Mon Aug 22 15:16:46 2005 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CE55416A41F; Mon, 22 Aug 2005 15:16:46 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7991543D48; Mon, 22 Aug 2005 15:16:46 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j7MFGjYI024461; Mon, 22 Aug 2005 08:16:46 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j7MFGjKm024460; Mon, 22 Aug 2005 08:16:45 -0700 Date: Mon, 22 Aug 2005 08:16:45 -0700 From: Brooks Davis To: Poul-Henning Kamp Message-ID: <20050822151645.GB22948@odin.ac.hmc.edu> References: <20050821115454.55441a64@Magellan.Leidinger.net> <58449.1124644626@phk.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8GpibOaaTibBMecb" Content-Disposition: inline In-Reply-To: <58449.1124644626@phk.freebsd.dk> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: Alexander Leidinger , Robert Watson , arch@freebsd.org Subject: Re: [CFR] reflect resolv.conf update to running application X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2005 15:16:46 -0000 --8GpibOaaTibBMecb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 21, 2005 at 07:17:06PM +0200, Poul-Henning Kamp wrote: > In message <20050821115454.55441a64@Magellan.Leidinger.net>, Alexander Le= idinger writes: > >On Sun, 21 Aug 2005 00:37:56 +0100 (BST) > >Robert Watson wrote: > > > >> (2) By reading the configuration file more frequently and more quickly > >> after a change, we increase the chances of a race condition in wh= ich > >> the resolve reads a partially written resolv.conf file during an > >> update. Does this happen in practice? I've always been very lee= ry of > >> re-reading configuration files automatically based on a time-stam= p, as > >> updates to files are not atomic at all. > > > >Can kqueue be used instead of polling? >=20 > Programs writing resolv.conf should just this the right way: >=20 > 1. Write new contents to temorary file. > 2. Rename temporary file to resolv.conf. The one issue with this is that we sortof support a read-only /etc with resolv.conf as a symlink to somewhere else. Short of following the symlink by hand in dhclient-script, you have to do the current cat trick. It should cause the file to be replaced in one write() though so I don't think the race exists (unless someone comes up with a dhclient config that generates a resolv.conf larger then 512-bytes). -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --8GpibOaaTibBMecb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFDCexcXY6L6fI4GtQRAnwpAKCppisI64Yt7wN2AlCC3V13GguoQQCgg2se +exN5BjjU6bSp+PppwuYHGE= =U4Lu -----END PGP SIGNATURE----- --8GpibOaaTibBMecb--