From owner-freebsd-rc@FreeBSD.ORG Mon Dec 26 09:11:54 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 10F281065670; Mon, 26 Dec 2011 09:11:54 +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 7937E14F59F; Mon, 26 Dec 2011 09:11:53 +0000 (UTC) Message-ID: <4EF83A59.8080008@FreeBSD.org> Date: Mon, 26 Dec 2011 01:11:53 -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: Garrett Cooper 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> In-Reply-To: <0A59E5CD-3598-41B0-A707-6C5185E80043@gmail.com> 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, Eygene Ryabinkin , 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: Mon, 26 Dec 2011 09:11:54 -0000 On 12/26/2011 01:02, Garrett Cooper wrote: > On Dec 26, 2011, at 12:43 AM, Doug Barton wrote: > >> On 12/26/2011 00:40, Eygene Ryabinkin wrote: >>> Doug, how that can be a failure? >> >> How does anything fail? Isn't that why you call it a "failure" >> instead of a "success?" >> >> But if Gleb is right and the problem is new to HEAD, when did it >> change, and why? > > 226879 rea if [ -z "${rc_force}" ] && ! dhcpif $ifn; > then 226879 rea err 1 "'$ifn' is not a > DHCP-enabled interface" 226879 rea fi > > $ 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: "The syntax of the return command is return [exitstatus] It terminates the current executional scope, returning from the previous nested function, sourced script, or shell instance, in that order. The return command is implemented as a special built-in command." It's actually used often'ish in rc.d where exit cannot be. > 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. I'll dig into the original change more tomorrow, now that it's clear what we're actually dealing with. Thanks to both of you for helping to make it clear. Doug -- [^L] Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/