[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#646137: live-boot-initramfs-tools: dhcp lease is not renewed when using netboot with nfsroot

Package: live-boot-initramfs-tools
Version: 2.0.15-1
Severity: normal

I am using a debian live system which is started via netboot.
The root file system lives in a squashfs-file on a NFS share (as usual)
and the network adress is acquired via dhcp.
Here is my /proc/cmdline:
boot=live vga=791 live-config=hostname,openssh-server netboot=nfs nfsroot= live-media-path=debian-live/$

When looking at the network traffic one can see that the DHCP lease is
never renewed. This means it might happen, that this address is given to
another client while my client still uses it.

The root of the problem lies in Bug #627166
"ipconfig: ignores dhcp options":

In the initramfs generated from /usr/share/initramfs-tools/hooks/live the
'ipconfig' tool is used to get an IP address via dhcp. As described in the bug
mentioned above ipconfig dos not report lease time, so this information is
not available. And no DHCP client is started later on.

Does NOT work: trying to force reallocation of the IP addrress via the "dhcp"
kernel comand line option does not work since then the network will disconnected
later in the boot sequence. -> not good with root on NFS :-)

Does work: I have just started 'dhclient' from the comand line when the system
is up. This spawns a dhclient deamon which properly renewes the lease as needed.
The network is not disconnected and everything is fine. I will try starting
dhclient from rc local later on, but don't see a reason why this should not work.

Proposed solution:
Since the information about which interface is started with dhcp is already made
available in the final root of the running system (/var/log/netboot.config and
/var/log/live.log) this information could be used to start a dhclient on this
interface later in the boot process. This still seems a bit like a hack since
the proper solution would imho require ipconfig to report the lease time, then
construct a proper /var/lib/dhcp/dhclient.leases file and only start dhclient
after that.
I also don't know what would be the best place to start the dhclient from.
Maybe live-config?

Here is my /proc/cmdline:
boot=live vga=791 live-config=hostname,openssh-server netboot=nfs nfsroot= live-media-path=debian-live/test01 initrd=debian-live/test01-x64.ird BOOT_IMAGE=debian-live/test01-x64.knl

-- System Information:
Debian Release: 6.0.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages live-boot-initramfs-tools depends on:
ii  busybox                       1:1.17.1-8 Tiny utilities for small and embed
ii  initramfs-tools               0.98.8     tools for generating an initramfs
ii  udev                          164-3      /dev/ and hotplug management daemo

live-boot-initramfs-tools recommends no packages.

live-boot-initramfs-tools suggests no packages.

-- no debconf information

Reply to: