Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Apr 2008 21:33:15 +0400
From:      Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To:        Zaphod Beeblebrox <zbeeble@gmail.com>
Cc:        Poul-Henning Kamp <phk@phk.freebsd.dk>, freebsd-current@freebsd.org
Subject:   Re: [RFC] Automated generation of /etc/resolv.conf from the rc.d script
Message-ID:  <H5MGge8Nl5z81vYo/6CbS41wm2w@BBB3ZKOzjjN0cxeKaWhgH87x7VY>
In-Reply-To: <5f67a8c40804141026s27672065sb11a7f327572c0f2@mail.gmail.com>
References:  <7ExUpek150AdEdP4WR1b6w@lz%2BEvuNSgXKgs9kqjMxQNA> <72123.1197626129@critter.freebsd.dk> <dEZnki0Fi32EvMrDEnqcgDeNQSc@Bbw9J2Iynx0QjNoWuQ4YSitYS3A> <5f67a8c40804141026s27672065sb11a7f327572c0f2@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <rea-fbsd@codelabs.ru>
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?H5MGge8Nl5z81vYo/6CbS41wm2w>