Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#3361 closed defect (fixed)

dhcp client script error

Reported by: Wayne Blaszczyk Owned by: Bruce Dubbs
Priority: normal Milestone:
Component: BOOK Version: SVN
Severity: normal Keywords:
Cc:

Description (last modified by Wayne Blaszczyk)

During boot up, /lib/services/dhclient produces an error:

line 35: [: too many arguments

Line 35 is:

if [ is_true "$PRINTIP" -o is_true "$PRINTALL" ]; then

Not sure where is_true is sourced from?

Change History (10)

comment:1 by Wayne Blaszczyk, 12 years ago

Description: modified (diff)

comment:2 by bdubbs@…, 12 years ago

is_true is in /lib/lsb/init_functions in LFS. It was added 04/09/12.

It might be easier to ask on -dev or -support

comment:3 by ken@…, 12 years ago

I'm seeing this, but only on my most recent build - so, the 9th April change is probably the reason. Doesn't seem to cause me any problems, so it's a low priority for me at the moment. But definitely a bug.

On my 7.1 build, the old blfs-bootscripts from 20120329 work fine. The build where I see it is LFS svn from 20120428 using lfs-bootscripts-20120409 with dhclient from blfs-bootscripts-20120421. So, the current dhclient script appears to be buggy, AND it appears to require init_functions from the current svn version of the LFS bootscripts.

comment:4 by bdubbs@…, 12 years ago

See if this works:

if is_true "$PRINTIP" -o is_true "$PRINTALL"; then

comment:5 by Wayne Blaszczyk, 12 years ago

It comes back with:

./dhclient: line 35: is_true: command not found

I'm working with LFS 7.1 stable. I hope we are not suggesting that the BLFS instructions are now only compatible/supported with the latest LFS-svn and not the lastest stable.

comment:6 by bdubbs@…, 12 years ago

You have a point. We use if_true in both the dhclient and bridge service scripts. I suppose we could add it to both scripts:

unset is_true

is_true()
{
   [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ] ||  
   [ "$1" = "y" ] || [ "$1" = "t" ]
}

Please add that to dhclient and see if it works for you.

At some point we should remove it, but I'm not sure what the criteria should be for that.

comment:7 by Wayne Blaszczyk, 12 years ago

It's working as expected now. That is, adding the is_true() function and removing the square brackets from the if statement fixed the problem.

Thanks.

comment:8 by bdubbs@…, 12 years ago

Owner: changed from blfs-book@… to Bruce Dubbs

OK, I'll update the scripts.

comment:9 by bdubbs@…, 12 years ago

Resolution: fixed
Status: newclosed

Updated service scripts in revision 10146.

comment:10 by bdubbs@…, 10 years ago

Milestone: current

Milestone current deleted

Note: See TracTickets for help on using tickets.