From owner-freebsd-current@FreeBSD.ORG Mon Apr 14 17:44:57 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3622E106564A for ; Mon, 14 Apr 2008 17:44:57 +0000 (UTC) (envelope-from zbeeble@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by mx1.freebsd.org (Postfix) with ESMTP id A5DE18FC25 for ; Mon, 14 Apr 2008 17:44:55 +0000 (UTC) (envelope-from zbeeble@gmail.com) Received: by ug-out-1314.google.com with SMTP id y2so534501uge.37 for ; Mon, 14 Apr 2008 10:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=Og4XD2FfZ+2Hi6LVtkhzJLt6QYiyVw6QVOtJnFxLM6E=; b=SvT+ajyTCI6ekXvczXAybx+tdbC5cjbSIN5T+70OleDKyjzY/0jDC4bOYtqHBDKTaAvWuxKon/WR7dAoDdI5Xh/qir1gD1m20EzQN9UcdYp39ufE/82xnRi9LNMmPCyoXYoMZtpb2Vfs+Z7AUt7esVMVuLXBjGfaa7XB8RJuzRY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=VRR61/tjch01JaxuGUGXq46bLRg7vfmszxFh48eRjZE3ISWjKJW1mCXiNwVMPNQp2rjam8ModIXZW8hJJaBhkJlfk3m0cMXLqquDQ3C7m0iZk97D09wvq5AziP2oVwrnE3QPWUssHCWcNrtZgx+xuG/dys+864weoeEMM4KtJhg= Received: by 10.150.137.8 with SMTP id k8mr6474227ybd.61.1208195093694; Mon, 14 Apr 2008 10:44:53 -0700 (PDT) Received: by 10.150.156.14 with HTTP; Mon, 14 Apr 2008 10:44:53 -0700 (PDT) Message-ID: <5f67a8c40804141044v69557b92w7db0b272d6b9b848@mail.gmail.com> Date: Mon, 14 Apr 2008 13:44:53 -0400 From: "Zaphod Beeblebrox" To: "Eygene Ryabinkin" In-Reply-To: MIME-Version: 1.0 References: <7ExUpek150AdEdP4WR1b6w@lz+EvuNSgXKgs9kqjMxQNA> <72123.1197626129@critter.freebsd.dk> <5f67a8c40804141026s27672065sb11a7f327572c0f2@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Poul-Henning Kamp , freebsd-current@freebsd.org Subject: Re: [RFC] Automated generation of /etc/resolv.conf from the rc.d script X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2008 17:44:57 -0000 On Mon, Apr 14, 2008 at 1:33 PM, Eygene Ryabinkin wrote: > Zaphod, good day. > > Mon, Apr 14, 2008 at 01:26:14PM -0400, Zaphod Beeblebrox wrote: > > On Fri, Dec 14, 2007 at 6:14 AM, Eygene Ryabinkin > > wrote: > > > This can be achieved with the script /etc/dhclient-exit-hooks that > > > will create the file with named 'forwarders' clause using values > > > from 'new_domain_name' and 'new_domain_name_servers' variables that > > > are exported to the hooks script by /sbin/dhclient-script. The > > > former file can be included from named.conf, so the restart or > > > reload of the local named instance from the exit hooks script will > > > do the trick. > > > > Last I tried, the OpenBSD dhclient we imported a year ago blithely > ignored > > the dhclient-exit-hooks scripts. > > Just now ($OpenBSD: dhclient-script,v 1.6 2004/05/06 18:22:41 claudio Exp > $, > $FreeBSD: src/sbin/dhclient/dhclient-script,v 1.17.2.2 2008/04/11 00:17:59 > brooks Exp $), dhclient-script invokes /etc/dhclient-exit-hooks: > ----- > # Must be used on exit. Invokes the local dhcp client exit hooks, if > any. > exit_with_hooks() { > exit_status=$1 > if [ -f /etc/dhclient-exit-hooks ]; then > . /etc/dhclient-exit-hooks > fi > # probably should do something with exit status of the local script > exit $exit_status > } > ----- > I refrained from using the exit hooks, because dhclient-script needs > modifications in my patch: it duplicates the functionality of > /etc/rc.d/resolv. Yes... well to be more clear, the OpenBSD dhclient didn't call dhclient-script for the EXIT cause. In fact, IIRC, the OpenBSD dhclient only called dhclient-script (which contains your code snippet) only for the initial setup (setting flags on the interface and such) The dhclient-script included with the OpenBSD dhclient (or at least the one we use) is largely the same as the isc-dhclient script. If you instrument the dhclient-script with some logging to check when it's called by dhclient, you may find it isn't called the documented number of times.