From owner-freebsd-rc@FreeBSD.ORG Tue Dec 27 06:32:14 2011 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 3536E1065672; Tue, 27 Dec 2011 06:32:14 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id A9A888FC08; Tue, 27 Dec 2011 06:32:13 +0000 (UTC) Received: by yhfq46 with SMTP id q46so8614184yhf.13 for ; Mon, 26 Dec 2011 22:32:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=ejIFZc4jYbVgq6Mc+NU5G6w2ELGLz/mqQtAZc9ySwvY=; b=oShkAFP9GNSNBv/GvGx+o8jSoJ8/HXMMC0rvfrkpY86fqckHIZWjXMeseN2ORBh6Hp Mv25XaI3rderG7KSjXZsBXDNJrFFsM0kkeP6w+IHY/1kT2IgocnnOL7hc3dZWYuQRrcG KrOHLFqaCzKMEYo8CcL6OiLn4lUrHKPSDU69I= Received: by 10.236.173.131 with SMTP id v3mr36191933yhl.112.1324967532663; Mon, 26 Dec 2011 22:32:12 -0800 (PST) Received: from [192.168.2.5] (dpc691944246.direcpc.com. [69.19.44.246]) by mx.google.com with ESMTPS id m38sm64195216anq.16.2011.12.26.22.31.57 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Dec 2011 22:32:12 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: Garrett Cooper In-Reply-To: <4EF93429.4020404@FreeBSD.org> Date: Mon, 26 Dec 2011 22:31:44 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <4EB6693F.2020102@delphij.net> <4EF93429.4020404@FreeBSD.org> To: Doug Barton X-Mailer: Apple Mail (2.1251.1) Cc: Brooks Davis , freebsd-rc@FreeBSD.ORG, Eygene Ryabinkin , Dag-Erling Smorgrav , d@delphij.net, Xin LI Subject: Re: Annoying ERROR: 'wlan0' is not a DHCP-enabled interface 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: Tue, 27 Dec 2011 06:32:14 -0000 On Dec 26, 2011, at 6:57 PM, Doug Barton wrote: > On 11/06/2011 03:02, Xin LI wrote: >> Hi, >>=20 >> It seems that 226879 have introduced an error indication where if an >> interface is up and is not set to DHCP, the devd invoked >> /etc/rc.d/dhclient wlan0 call would generate an annoying message. >>=20 >> I think this message is not necessary at all -- normally >> /etc/rc.d/dhclient is used by the system and it's just legitimate = that >> a network interface comes up and have not assigned as DHCP. >>=20 >> I'd like to propose the attached change, which turns this message = into >> debug message but keep the exit intact. >=20 > The discussion about changing the error message in rc.d/dhclient is > applying the fix to the wrong location. Thanks to Eygene's help in > understanding the history of where the error message came from I have > what I believe to be a better suggestion. >=20 > History: >=20 > Prior to, and after, des' changes in r226345 and r226464 if > rc.d/dhclient was called for a non-DHCP interface it returned with = exit > code 1, but without an error. What des added was an additional test = for > whether or not rc_force is set. This is a feature, because it allows = one > to do 'service dhclient forcestart em0' and have DHCP configuration > attempted even if it's not configured in rc.conf. >=20 > In r226879 rea astutely observed that rc_force is only visible in > certain contexts, and added a better check for that. He also added an > error message that did not previously exist. >=20 > The Problem: >=20 > /etc/rc.d/dhclient is called unconditionally from devd.conf every time > the interface comes up. If the interface is not configured to use = DHCP, > this generates an error in the logs that did not exist prior to = r226879. >=20 > My proposed solution: >=20 > Make devd.conf smarter about how it tries to bring the interface up. > This is accomplished rather easily in the attached patch, which uses > netif instead of dhclient. The virtue of this solution is that it will > use whatever configuration exists for the interface, and will not call > rc.d/dhclient spuriously. >=20 > Brooks added the dhclient invocation to devd.conf in r147088 back in > 2005-06-06. I've cc'ed him to ask if there is any obvious reason why > using netif instead wouldn't be a good idea. The only misgiving that I have about this is that it deletes the = default route and might cause issues with firewalls, natd, more = complicated interface types like laggs, vlans, etc. It annoys me that = torquing the network via rc.d ties FreeBSD into knots still today :(. I'll gladly test this out when I get a chance though sometime = this week. Thanks, -Garrett=