From owner-freebsd-rc@FreeBSD.ORG Tue Dec 27 03:17:42 2011 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id C5B47106566C; Tue, 27 Dec 2011 03:17:42 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id C9E6B14EE42; Tue, 27 Dec 2011 03:17:41 +0000 (UTC) Message-ID: <4EF938D5.7060801@FreeBSD.org> Date: Mon, 26 Dec 2011 19:17:41 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Eygene Ryabinkin References: <4EF6401E.3080902@FreeBSD.org> <20111224215649.GA12789@stack.nl> <4EF80CA7.3070303@FreeBSD.org> <4EF82E3B.6040601@FreeBSD.org> <4EF833B7.9040704@FreeBSD.org> <0A59E5CD-3598-41B0-A707-6C5185E80043@gmail.com> <4EF83A59.8080008@FreeBSD.org> In-Reply-To: X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Pyun Yong-Hyeon , d@delphij.net, Garrett Cooper , Gleb Smirnoff , freebsd-rc@freebsd.org 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 03:17:42 -0000 On 12/26/2011 01:52, Eygene Ryabinkin wrote: > Mon, Dec 26, 2011 at 01:11:53AM -0800, Doug Barton wrote: >> On 12/26/2011 01:02, Garrett Cooper wrote: >>> $ svn log -r 226879 >>> ------------------------------------------------------------------------ >>> >>> >> r226879 | rea | 2011-10-27 23:03:38 -0700 (Thu, 27 Oct 2011) | 10 lines >>> >>> Fix handling of rc_force in /etc/rc.d/dhclient >>> >>> Variable 'rc_force' is accessible only at the time of >>> rc_run_command, so it can't be examined from the script's main code. >>> >>> Spotted by: hrs Reviewed by: hrs, des Approved by: des MFC after: 2 >>> weeks >>> ------------------------------------------------------------------------ >>> >>> It simply didn't exist before this change; before it was just a >>> 'return 1', which is illegal outside of functions, amongst other >>> things. >> >> Ok, so I think here is some of the source of the confusion: > > Unlikely that the confusion will come from my side: I didn't say *you* were confused about this, I said "the confusion." :) > The whole story is the following one. Thanks for your background information. I dug through the svn logs and you are of course correct that the error message didn't exist prior to your change. However I think the error message is still valuable because it will catch problems such as: ifconfig_em0='DHPC' I just sent a response to delphij's original message with what I think is a better solution, attempt to more properly configure the interface from devd.conf in the first place. This avoids spuriously calling rc.d/dhclient. >>> So I vote to just remove the message (convert the err 1 to a exit 1) >> >> I haven't dug into it yet, but if it was a return previously it almost >> certainly should not be an exit now. > > Doug, I may be blunt now, but how can one ever say something about the > code that he hasn't digged into? I know about the common sense, but > it alone can't be applied to the non-trivial problems with any hope > for good results. Please note that I qualified my statement, precisely because I had not yet dug deeply into it. However, to answer your question "how can one ever say something about the code that he hasn't digged into?": 1. Years of experience 2. Depth of understanding of the rc.d code generally 3. A finely honed filter which detects "This smells like fixing a symptom rather than fixing the actual problem." In the end it seems that I was right, dhclient was the wrong place to address this issue. I even suggested that the proper place to fix it was in devd.conf. Now you can say that I just got lucky, but I would beg to differ. :) Doug -- [^L] Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/