Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Dec 2011 01:11:53 -0800
From:      Doug Barton <dougb@FreeBSD.org>
To:        Garrett Cooper <yanegomi@gmail.com>
Cc:        Pyun Yong-Hyeon <pyunyh@gmail.com>, d@delphij.net, Eygene Ryabinkin <rea@freebsd.org>, Gleb Smirnoff <glebius@FreeBSD.org>, freebsd-rc@freebsd.org
Subject:   Re: Annoying ERROR: 'wlan0' is not a DHCP-enabled interface
Message-ID:  <4EF83A59.8080008@FreeBSD.org>
In-Reply-To: <0A59E5CD-3598-41B0-A707-6C5185E80043@gmail.com>
References:  <n2Hlz4MXZMNcNzN56fSf6/or7Ig@YnbH/K3/Y1Z96RV2jTofcGuSPJI> <4EF6401E.3080902@FreeBSD.org> <20111224215649.GA12789@stack.nl> <4EF80CA7.3070303@FreeBSD.org> <ooDmUS7742YMCurT/5XDO19d%2BS4@g5jH1yj%2BTnAiSdLOy3xs5Jutvhc> <4EF82E3B.6040601@FreeBSD.org> <KjrN1twOoYYUBTKZXsHphbGonrU@g5jH1yj%2BTnAiSdLOy3xs5Jutvhc> <4EF833B7.9040704@FreeBSD.org> <0A59E5CD-3598-41B0-A707-6C5185E80043@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EF83A59.8080008>