Re: [RFC] Automated generation of /etc/resolv.conf from the rc.d script

From: Zaphod Beeblebrox <zbeeble_at_gmail.com>
Date: Mon, 14 Apr 2008 13:44:53 -0400
On Mon, Apr 14, 2008 at 1:33 PM, Eygene Ryabinkin <rea-fbsd_at_codelabs.ru>
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 <rea-fbsd_at_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.


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.
Received on Mon Apr 14 2008 - 15:44:57 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:29 UTC