From owner-freebsd-current@FreeBSD.ORG Mon Apr 14 17:33:21 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 5AAC410656C1 for ; Mon, 14 Apr 2008 17:33:21 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 0B6AE8FC1B for ; Mon, 14 Apr 2008 17:33:21 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:Sender:X-Spam-Status:Subject; b=Xg2gxnpfjDSJzOH1+uSwXcOlfiFf24HCdNWp1gLX+9aKy5C2FpC49URY3BjSrgro1SnKfKvFXCqBJLGxVx70yDU6F0hZKlY58oG3BQlAkOvOscXwgm6xPp1dwTLLSeOcw9ljKDxXgyOMVgC5XE0bp5a8Bbgh1Q3Kn7YT7lhyFGM=; Received: from pb-d-128-141-128-154.cern.ch (pb-d-128-141-128-154.cern.ch [128.141.128.154]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1JlSYR-0003pD-7N; Mon, 14 Apr 2008 21:33:19 +0400 Date: Mon, 14 Apr 2008 21:33:15 +0400 From: Eygene Ryabinkin To: Zaphod Beeblebrox Message-ID: References: <7ExUpek150AdEdP4WR1b6w@lz+EvuNSgXKgs9kqjMxQNA> <72123.1197626129@critter.freebsd.dk> <5f67a8c40804141026s27672065sb11a7f327572c0f2@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <5f67a8c40804141026s27672065sb11a7f327572c0f2@mail.gmail.com> Sender: rea-fbsd@codelabs.ru X-Spam-Status: No, score=-1.3 required=4.0 tests=ALL_TRUSTED,AWL,BAYES_50 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:33:21 -0000 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. Thanks for the suggestions! -- Eygene