Annoying ERROR: 'wlan0' is not a DHCP-enabled interface

Doug Barton dougb at FreeBSD.org
Mon Dec 26 09:11:54 UTC 2011


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/



More information about the freebsd-rc mailing list