Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Sep 2010 07:19:11 -0700
From:      Jeremy Chadwick <freebsd@jdc.parodius.com>
To:        Ed Maste <emaste@freebsd.org>
Cc:        Doug Barton <dougb@FreeBSD.org>, freebsd-rc@freebsd.org
Subject:   Re: Wait for carrier in /etc/rc.d/defaultroute
Message-ID:  <20100930141911.GA19108@icarus.home.lan>
In-Reply-To: <20100930135752.GA81590@sandvine.com>
References:  <20100925000435.GA62501@sandvine.com> <4CA15FC8.8010106@FreeBSD.org> <20100929074628.GA83194@icarus.home.lan> <20100929100100.GA83642@icarus.home.lan> <20100930135752.GA81590@sandvine.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 30, 2010 at 09:57:52AM -0400, Ed Maste wrote:
> On Wed, Sep 29, 2010 at 03:01:00AM -0700, Jeremy Chadwick wrote:
> 
> > > Ack, I forgot all about this (and despite recommending the script to
> > > someone on the lists a couple weeks ago)!  The script Doug's referring
> > > to is available below, and should be placed into /usr/local/etc/rc.d (be
> > > sure to chmod 755/555 it as well):
> > > 
> > > http://jdc.parodius.com/freebsd/netwait
> > > 
> > > Example usage in /etc/rc.conf:
> > > 
> > > netwait_enable="yes"
> > > netwait_ip="4.2.2.1 4.2.2.2"
> > > netwait_if="em0"
> > > netwait_timeout="15"
> 
> I think the approach in this script is overall reasonable, but one thing
> I prefer about the current /etc/rc.d/defaultroute is that it doesn't
> need to be configured with a specific IP address, so it can "just work"
> out of the box.
> 
> Jeremy, was your primary motivation for netwait DHCP, or are there other
> bootup issues you had to address with it as well?

The primary motivation was 1) witnessing DNS lookup failures reported by
both named (unable to reach root servers) and ntpd (unable to resolve
NTP server FQDNs) by our machines in our co-lo, and 2) *many* people
in the community needing this.  Our co-lo machines *do not* use DHCP,
and there are some community users who do not use DHCP but have *many*
network cards in use, combined with vlan(4), and some wild network
configurations which have to be taken into consideration.

Users, understandably, think link state represents a usable network but
that simply isn't the case.  I don't want to get into a discussion about
what happens when things like LLDP or STP are in use on switches either
(link is up but the network isn't, and for up to something like 30
seconds; yeah yeah yeah, RSTP exists and all that, I know).  :-)  I feel
that's why netwait or equivalent is important.

> What do you think about combining the two, so that we'd have the current
> functionality if DHCP is in use and netwait_ip is not set, and the ping
> check if netwait_ip is set (regardless of the DHCP setting)?

I think this is something the rest of the community can discuss and work
out, or maybe freebsd-rc@ specifically.  Honestly, it doesn't matter to
me, but I'd much rather someone else drive that piece of the effort.  If
someone wants to commit something that incorporates all or part of my
work, whether it be a separate rc script or merge it into defaultroute,
that's great, I'm 100% cool with that.

Just be aware you can't just copy-paste or "drop in" the netwait code
into defaultroute and have it work; the rc order matters greatly
(BEFORE/REQUIRE lines).  Run "rcorder /etc/rc.d/* /usr/local/etc/rc.d/*"
sometime to see what I mean.

Also, yesterday I opened a PR on getting the script committed to the
base system.  It might be a good place to take the discussion so there's
a log and so on -- or, if folks wanna continue discussing it here,
that's fine too.  Here's the PR:

http://www.freebsd.org/cgi/query-pr.cgi?pr=151063

-- 
| Jeremy Chadwick                                   jdc@parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.              PGP: 4BD6C0CB |




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