Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55437 - net script output is not pretty
Summary: net script output is not pretty
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 66472
  Show dependency tree
 
Reported: 2004-06-28 09:03 UTC by Jory A. Pratt
Modified: 2004-10-24 21:41 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fixes dhcp problem (net.eth0.dchp.patch,888 bytes, patch)
2004-06-28 11:47 UTC, Roy Marples (RETIRED)
Details | Diff
Fixes dhcp problem (net.eth0.dchp.patch,888 bytes, patch)
2004-06-28 11:48 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jory A. Pratt 2004-06-28 09:03:46 UTC
bad syntax at line 441 in /sbin/rc, this is with baselayout 1.10. There is no additional information given on the syntax error.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Harm Geerts 2004-06-28 09:55:50 UTC
# /etc/init.d/net.eth0 restart
 * Bringing eth0 down...
 *   Releasing DHCP lease for eth0                                        [ ok ]
 *   Stopping eth0
RTNETLINK answers: Invalid argument                                       [ ok ]
 * Bringing eth0 up...
 *   eth0 dhcp                                                            [ ok ]
 *     eth0 received address 10.0.0.2
/sbin/runscript.sh: line 441: ((: 10.0.0.2: syntax error in expression (error token is ".0.0.2")
Comment 2 Harm Geerts 2004-06-28 09:58:56 UTC
Forgot to include this, I'm using the new-style ifconfig for dhcp with these settings.

# To use DHCP on eth0, simply uncomment the following line:
ifconfig_eth0=( "dhcp" )

# For passing custom options to dhcpcd use something like the following.  This
# example reduces the timeout for retrieving an address from 60 seconds (the
# default) to 10 seconds.  Note that this might be too short for some servers,
# so the default is encouraged unless you know what you're doing.
dhcpcd_eth0="-t 10 -h manuel"
Comment 3 ferret 2004-06-28 10:15:12 UTC
I get the same thing, Even when I only have this line in my config:

ifconfig_eth0=( "dhcp" )

/sbin/runscript.sh contains this:

...
   439  for arg in $*
   440  do
>  441          case "${arg}" in
   442          --quiet)
   443                  RC_QUIET_STDOUT="yes"
   444                  ;;
   445  # We check this in functions.sh ...
   446  #       --nocolor)
   447  #               RC_NOCOLOR="yes"
   448  #               ;;
   449          esac
   450  done
...
Comment 4 Arve Knudsen 2004-06-28 10:33:33 UTC
I found the error, its at line 441 of /etc/init.d/net.eth0. Was about to report it myself; for whatever reason the author is being economical and reusing a variable (${i}), so that an IP address is used for comparison. I changed lines 462 and 463 to (if you look closely you'll see I've replaced 'i' with 'addr'):
[code]
addr=$(ifconfig ${1} | grep -m1 -o 'inet addr:[^ ]*' | cut -d: -f2)
[[ -n ${addr} ]] && einfo "    ${iface} received address ${addr}"
[/code]
Another case for automated tests of core scripts?
Comment 5 Roy Marples (RETIRED) gentoo-dev 2004-06-28 11:47:43 UTC
Created attachment 34343 [details, diff]
Fixes dhcp problem
Comment 6 Roy Marples (RETIRED) gentoo-dev 2004-06-28 11:48:14 UTC
Created attachment 34344 [details, diff]
Fixes dhcp problem

Patch to net.eth0 to fix the problem.

Damn silly bug to get through this
Comment 7 Aron Griffis (RETIRED) gentoo-dev 2004-06-28 13:32:20 UTC
Thanks, I fixed this problem in baselayout-1.10.1:
    /sbin/runscript.sh: line 441: ((: 10.0.0.2: syntax error in expression (error token is ".0.0.2")

However I have not yet fixed this one because I hadn't seen this bug report yet:
    *   Stopping eth0
    RTNETLINK answers: Invalid argument                                       [ ok ]

I'll get that fixed too
Comment 8 Jory A. Pratt 2004-06-28 17:13:14 UTC
However I have not yet fixed this one because I hadn't seen this bug report yet:
    *   Stopping eth0
    RTNETLINK answers: Invalid argument                                       [ ok ]



I have yet to see this error any where, due you think someone may not have updated there configs properly :)
Comment 9 Aron Griffis (RETIRED) gentoo-dev 2004-06-29 17:48:22 UTC
Jory, you probably just don't have iproute2 installed, which would be necessary to repeat that symptom.

Spyderous, why did you add yourself to this bug?  It's essentially fixed already.  The only remaining problem is cosmetic.
Comment 10 Donnie Berkholz (RETIRED) gentoo-dev 2004-06-29 19:32:58 UTC
Because my startup isn't pretty yet. =)
Comment 11 Aron Griffis (RETIRED) gentoo-dev 2004-10-24 21:41:40 UTC
believe all this is fixed in baselayout-1.11.x

feel free to re-open if you see the RTNETLINK problem