Red Hat Bugzilla – Bug 198601
Pass the DHCP lease from the initrd to dhclient
Last modified: 2007-11-30 17:11:37 EST
With nash's "network --bootproto dhcp" command, the initrd obtains a DHCP lease
and brings up the device.
However, if this device is configured to be brought up at boot time (ONBOOT=yes)
with dhcp (BOOTPROTO=dhcp) by the init scripts, the device is first brought down
and then a new DHCP lease is obtained before bringing the device back up.
This is obviously pretty catastrophic when the root filesystem is on NFS.
The most correct fix seems to be to allow the initrd to pass the lease onto
dhclient, in which case dhclient won't re-configure the device.
Attaching patches which takes a first cut at this.
The mkinitrd patch does the following:
- Makes libdhcp write out the lease
- Adds a lame "cp" command to nash
- Makes setuproot mount a tmpfs on /sysroot/var/lib/initrd
- Copies the lease to there
The initscripts patch does the following:
- Creates the /var/lib/initrd dir
- In ifup-eth, copies any lease for that device from /var/lib/initrd
 - If we're not happy with /var/lib/dhclient/dhclient.leases as the location
for this, we have the following options:
- change libdhcp's pumpDhcpClassRun() to accept a path for the lease
and pass that using "-lf <path>" to libdhcp4client's dhcpv4_client()
- set the PATH_DHCLIENT_DB env var with the path for the lease
Created attachment 132287 [details]
Created attachment 132288 [details]
One problem with this is that it doesn't work if you have /var as a separate
filesystem (which we allow, and lots of people do). :-/
how about /initrd ? :/
Well, if you want someplace writable, that pretty much leaves /dev.
/initrd is dead, AFAIR.
(In reply to comment #5)
> Well, if you want someplace writable, that pretty much leaves /dev.
> /initrd is dead, AFAIR.
Sure, but it could be re-incarnated :)
We could make ourselves feel a bit better by saying /initrd is a "generic
mechanism for the initrd to pass stuff to initscripts" so, e.g. the initrd could
generate the root fstab entry this way too.
In rc.sysinit, we use /dev/.in_sysinit for some ugly temporary bookkeeping.
Defining something else could work, altough the LSB/FHS would probably yell at us.
Created attachment 132308 [details]
Created attachment 132309 [details]
Okay, updated (but didn't test yet) the patches to copy the lease into /dev
Seems OK visually. Added in initscripts CVS.
In mkinitrd as well.