Bug 2840 - busybox: udhcpc misbehavior when "ip=dhcp"
Summary: busybox: udhcpc misbehavior when "ip=dhcp"
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.3
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.3 M3
Assignee: Jesse Zhang
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2012-07-27 05:21 UTC by Jesse Zhang
Modified: 2012-09-04 03:29 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Zhang 2012-07-27 05:21:48 UTC
I recently found that if "ip=dhcp" is specified in the kernel cmdline,
there would be some strange behaviour of udhcpc.

1. udhcpc is started two times during bootup.

    Starting Bootlog daemon: bootlogd.
    Configuring network interfaces... udhcpc (v1.19.4) started
    Sending discover...
    Sending select for 128.224.162.132...
    Lease of 128.224.162.132 obtained, lease time 172800
    /etc/udhcpc.d/50default: Adding DNS 128.224.160.11
    /etc/udhcpc.d/50default: Adding DNS 147.11.100.30
    /etc/udhcpc.d/50default: Adding DNS 147.11.1.11
    done.
    Starting portmap daemon...
    [...]
    Starting domain name service: named.
    udhcpc (v1.19.4) started
    Sending discover...
    Sending select for 128.224.162.132...
    Lease of 128.224.162.132 obtained, lease time 172800
    RTNETLINK answers: File exists
    /etc/udhcpc.d/50default: Adding DNS 128.224.160.11
    /etc/udhcpc.d/50default: Adding DNS 147.11.100.30
    /etc/udhcpc.d/50default: Adding DNS 147.11.1.11
    creating NFS state directory: done

2. udhcpc is *started* when system is being shutdown.

    Stopping domain name service: namedrndc: neither /etc/bind/rndc.conf nor /etc/bind/rndc.key wd
    .
    udhcpc (v1.19.4) started
    Sending discover...
    Sending select for 128.224.162.132...
    Lease of 128.224.162.132 obtained, lease time 172800
    RTNETLINK answers: File exists
    /etc/udhcpc.d/50default: Adding DNS 128.224.160.11
    /etc/udhcpc.d/50default: Adding DNS 147.11.100.30
    /etc/udhcpc.d/50default: Adding DNS 147.11.1.11
    Stopping system message bus: dbus.
    stopping statd: done

The reason is busybox installs a busybox-udhcpc init script, which would
start udhcpc when "ip=dhcp" is specified, but udhcpc is also invoked by
the networking service (as specified through /etc/network/interfaces).
That's why udhcpc is started twice.

And since the init script doesn't actually support "stop" actions, it
will start udhcpc again during system shutdown.

The obvious fix is to remove the busybox-udhcpc init script; all configs
should go through /etc/network/interfaces.

P.S. it only happens for non-qemu targets since they have different
configs. I used an intel emenlow.
Comment 2 liang li 2012-09-04 03:29:12 UTC
verified on mpc8315e-rdb board with nightly build 20120822-1 ,when change command line to "ip=dhcp",no such error.
git info:bb0aab79e488a99cb1b43f72f0e8ddbe39d97519
git branch :poky/master