From owner-freebsd-arch@FreeBSD.ORG Sun Aug 21 17:17:10 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 4CCA116A41F; Sun, 21 Aug 2005 17:17:10 +0000 (GMT) (envelope-from phk@phk.freebsd.dk) Received: from haven.freebsd.dk (haven.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id E521043D45; Sun, 21 Aug 2005 17:17:09 +0000 (GMT) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (unknown [192.168.48.2]) by haven.freebsd.dk (Postfix) with ESMTP id 93F1DBC66; Sun, 21 Aug 2005 17:17:06 +0000 (UTC) To: Alexander Leidinger From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 21 Aug 2005 11:54:54 +0200." <20050821115454.55441a64@Magellan.Leidinger.net> Date: Sun, 21 Aug 2005 19:17:06 +0200 Message-ID: <58449.1124644626@phk.freebsd.dk> Sender: phk@phk.freebsd.dk Cc: arch@freebsd.org, Robert Watson 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: Sun, 21 Aug 2005 17:17:10 -0000 In message <20050821115454.55441a64@Magellan.Leidinger.net>, Alexander Leidinger 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 which >> the resolve reads a partially written resolv.conf file during an >> update. Does this happen in practice? I've always been very leery of >> re-reading configuration files automatically based on a time-stamp, as >> updates to files are not atomic at all. > >Can kqueue be used instead of polling? Programs writing resolv.conf should just this the right way: 1. Write new contents to temorary file. 2. Rename temporary file to resolv.conf. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.