Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jun 2010 02:33:57 -0700
From:      Jeremy Chadwick <freebsd@jdc.parodius.com>
To:        Doug Barton <dougb@FreeBSD.org>
Cc:        freebsd-rc@freebsd.org, John Marshall <john.marshall@riverwillow.com.au>
Subject:   Re: rc(8) script -- waiting for the network to become usable
Message-ID:  <20100603093357.GA1849@icarus.home.lan>
In-Reply-To: <4C074C11.20807@FreeBSD.org>
References:  <20100603020444.GL1875@rwpc12.mby.riverwillow.net.au> <20100603044530.GA93342@icarus.home.lan> <4C074C11.20807@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 02, 2010 at 11:30:41PM -0700, Doug Barton wrote:
> On 06/02/10 21:45, Jeremy Chadwick wrote:
> >There have been quite a few changes to the script over the past few
> >months, mainly due to a user with a complex setup (multiple NICs, use of
> >vlan(4), and some other stuff).
> 
> Sounds like you've been making good progress. :)

Painful progress, actually.  :-)  I have quite a long thread (~20+
mails) with the user about the ping check immediately exiting, etc. on
his system.  Based on all the analysis and debugging efforts, it looks
as if bge behaves a little differently than other drivers; the overall
methodology change should work universally.  I stole the link status
check method from /etc/rc.d/defaultroute.

> Overall looks good, I've attached a patch with a few tweaks, mostly
> style. See http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/rc-scripts.html
> for more information.
> 
> The default empty variable assignments are not desirable.
> 
> If the script is enabled (which is the only way start_cmd will run)
> then netwait_ip being empty is a fatal error.
> 
> I think the 'trap break' trick will work, give it a try. :)

As usual, thanks a ton, Doug!

I've incorporated your changes (I understand them all) and agree with
your variable rename suggestion (iface --> if).  I also removed some of
the echo statements that referenced /bin/date and so on -- those were
left in from the debugging session with aforementioned user.  Oops.

John et al, I've updated the script on my site:

http://jdc.parodius.com/freebsd/netwait

Be sure to rename your netwait_iface and netwait_iface_timeout rc.conf
assignments (if any) as appropriate.

Please let me know if there's any problems.

-- 
| 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?20100603093357.GA1849>