rc(8) script -- waiting for the network to become usable
Jeremy Chadwick
freebsd at jdc.parodius.com
Thu Jun 3 09:47:15 UTC 2010
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 at parodius.com |
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP: 4BD6C0CB |
More information about the freebsd-rc
mailing list