From owner-freebsd-rc@FreeBSD.ORG Thu Sep 30 14:32:22 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46D16106566C for ; Thu, 30 Sep 2010 14:32:22 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta14.emeryville.ca.mail.comcast.net (qmta14.emeryville.ca.mail.comcast.net [76.96.27.212]) by mx1.freebsd.org (Postfix) with ESMTP id 2D03B8FC17 for ; Thu, 30 Sep 2010 14:32:22 +0000 (UTC) Received: from omta16.emeryville.ca.mail.comcast.net ([76.96.30.72]) by qmta14.emeryville.ca.mail.comcast.net with comcast id D0m81f0021ZMdJ4AE2KCmm; Thu, 30 Sep 2010 14:19:12 +0000 Received: from koitsu.dyndns.org ([98.248.41.155]) by omta16.emeryville.ca.mail.comcast.net with comcast id D2KB1f00H3LrwQ28c2KBV6; Thu, 30 Sep 2010 14:19:12 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 6B0849B418; Thu, 30 Sep 2010 07:19:11 -0700 (PDT) Date: Thu, 30 Sep 2010 07:19:11 -0700 From: Jeremy Chadwick To: Ed Maste Message-ID: <20100930141911.GA19108@icarus.home.lan> References: <20100925000435.GA62501@sandvine.com> <4CA15FC8.8010106@FreeBSD.org> <20100929074628.GA83194@icarus.home.lan> <20100929100100.GA83642@icarus.home.lan> <20100930135752.GA81590@sandvine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100930135752.GA81590@sandvine.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Doug Barton , freebsd-rc@freebsd.org Subject: Re: Wait for carrier in /etc/rc.d/defaultroute X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2010 14:32:22 -0000 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 |