From: Ian Campbell Subject: Re: [OSSTEST PATCH] cat-dhcp-leases: new script Date: Fri, 3 Oct 2014 16:11:59 +0100 Message-ID: <1412349119.12695.27.camel@citrix.com> References: <1412348812-2850-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xa4X2-0005CR-UD for xen-devel@lists.xenproject.org; Fri, 03 Oct 2014 15:12:33 +0000 In-Reply-To: <1412348812-2850-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Fri, 2014-10-03 at 16:06 +0100, Ian Jackson wrote: > ISC dhcpd treates /var/lib/dhcp3/leases as a log-structured database, > appending records to it and periodically rewriting it. When it > decides to rewrite it it writes the new contents to a temporary file - > fine. > > But rather than renaming the temporary file into place, over the top > of the old file, using rename(2), it first renames the old leases file > to leases~. So briefly there is no leases file. > > This means that the service used by Osstest/DhcpWatch/leases.pm when a > hostname and port is specified has to try various different files. > > This is the appropriate shell script, which is most conveniently > maintained here in osstest. It can be used by putting something like > this in inetd.conf: > > 5556 stream tcp nowait nobody /root/cat-dhcp-leases cat-dhcp-leases > > Signed-off-by: Ian Jackson How very tedious. Acked-by: Ian Campbell