From owner-freebsd-stable@FreeBSD.ORG Wed Dec 15 01:43:07 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DF7F1065672; Wed, 15 Dec 2010 01:43:07 +0000 (UTC) (envelope-from lichray@gmail.com) Received: from mail-ey0-f178.google.com (mail-ey0-f178.google.com [209.85.215.178]) by mx1.freebsd.org (Postfix) with ESMTP id E0D088FC13; Wed, 15 Dec 2010 01:43:06 +0000 (UTC) Received: by eyh5 with SMTP id 5so739684eyh.37 for ; Tue, 14 Dec 2010 17:43:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=O3pMq3dwfG3tey7/6Xo5JOzDNOSTeQfAGdujnXG2c0w=; b=Wx64KqHEhIa7bcg2CdK5SiQiy5cH//yPE7ZZj1unPDBoCpwGYYh9tG2gZXucOY1egN h0S2bJJcv69XY4NxJClyMq8P4qFsSPAiia1KLCn4JW0o6omz87vZFtw+KkVRgmIACgtH ySu5oXmNrPPsWbgLu01BR7OwmPTvekBWcc70c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=cR5ZskcEu8nA6L7tjnKr0F2Z9Gfuc0s1wC14ogVdY/VW1hwn8vMt/nW5fG1PZXRgr7 zrGs8I8Piny0SRJZMNWnI0ZkB8StIwMjF8GJO9FG6zy5AkfN7dJUgoF8WK5mRKxpXDke HkJ2RaNugxaJ4yFnQGrOuuU68SOrctB7B9WsI= MIME-Version: 1.0 Received: by 10.213.30.7 with SMTP id s7mr1205442ebc.20.1292377384786; Tue, 14 Dec 2010 17:43:04 -0800 (PST) Received: by 10.213.4.4 with HTTP; Tue, 14 Dec 2010 17:43:04 -0800 (PST) In-Reply-To: <20101215011247.GA56591@icarus.home.lan> References: <20101215004712.GA56065@icarus.home.lan> <20101215011247.GA56591@icarus.home.lan> Date: Tue, 14 Dec 2010 19:43:04 -0600 Message-ID: From: Zhihao Yuan To: Jeremy Chadwick Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Dan Allen , dougb@freebsd.org, FreeBSD-STABLE Mailing List Subject: Re: ntpd fails on boot X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 01:43:07 -0000 I read your script. OK. My question is, how can I use more than 1 netwait_if? I know I can just use netwait_ip instead, but, for example, in a mDNS configured environment, ping may take a long time to response. In some conditions, it can be 1min. So I don't want to use the fallback 'ping' method. Most laptops today have both LAN and WLAN internet faces, some of them have even more. So please give my 'utter nonsense' an answer. On Tue, Dec 14, 2010 at 7:12 PM, Jeremy Chadwick wrote: > On Tue, Dec 14, 2010 at 06:55:22PM -0600, Zhihao Yuan wrote: > > ping is slow. I hope that we can change the behavior of detecting network > to > > something event driven. Like to insert a script into syslogd to detect > the > > host's dhclient status (in a static IP environment, we don't need > > 'netwait'), or check ifconfig, something like that. > > > > On Tue, Dec 14, 2010 at 6:47 PM, Jeremy Chadwick > > wrote: > > > > > On Tue, Dec 14, 2010 at 05:38:49PM -0700, Dan Allen wrote: > > > > Recently my network connection now is setup AFTER ntpd is launched > rather > > > than before. > > > > > > > > So when ntpd starts there is no net connection and it gives up. > > > > > > > > I read /usr/src/UPDATING but nothing is mentioned about a change in > boot > > > order. > > > > > > > > Any ideas? > > > > > > This issue has been discussed pretty thoroughly in the past. There's > no > > > official solution, but there is an rc.d script I wrote which addresses > > > this shortcoming. Nothing related to the "boot order" has changed, but > > > network drivers and overall methodology has changed. > > > > > > Anyway, many people are using the below with success. > > > > > > http://jdc.parodius.com/freebsd/netwait > > > > > > Official patches, including the rc.conf(5) change I propose: > > > > > > http://jdc.parodius.com/freebsd/netwait_patches/ > > > > > > Example usage (in rc.conf): > > > > > > netwait_enable="yes" > > > netwait_ip="4.2.2.1 4.2.2.2" > > > netwait_if="em0" > > > > > > For what these variables mean, please see the script itself. They are > > > thoroughly documented. > > I don't know what "ping is slow" means -- utter nonsense. Read the > script. Look at how it works please. Seriously. I spent a lot of time > on it, with the help of a lot of community members (including some with > very complex network setups (multiple NICs of different brands, VLANs, > custom routes)). > > netwait is in no way a permanent solution -- it simply addresses most > non-complex environments *reliably*. ifconfig, devd, etc. are not > sufficient ways of determining if the network is *actually usable*. I > cannot stress this enough. I am not talking out of my ass. > > What everyone's proposing (launchd, "way to monitor syslog", > event-driven, blah blah) is wonderful, but until someone has actually > done it, it's just ideal talk. These words are coming from someone > who's very much an idealist, so keep that in mind too; I'm one of the > "worst offenders" when it comes to recommending solutions but not having > the time to implement them. > > I'm going to bow out of the conversation at this point and simply ask > folks here on the thread to take the time to dig up/read old mailing > list archives on the matter. We (FreeBSD Community and the freebsd-rc > folks) have been over all of this before. > > Sorry for sounding crass and rude, but every time this question comes > up, I feel like I have to "defend" why the netwait script exists, why it > was designed the way it was, and so on. Yes, a better infrastructure is > needed to solve the problem *at the core*, but until someone writes > that, we need something that works. > > -- > | 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 | > > -- Zhihao Yuan The best way to predict the future is to invent it.