[Bug 2065037] Re: dhcpcd is called before interfaces have carrier causing a 29 seconds boot delay

Benjamin Drung 2065037 at bugs.launchpad.net
Tue May 7 12:50:49 UTC 2024


Thanks. Next iteration. Here is the updated logging function:

```
log_flags() {
	echo "*******************"
	for device in /sys/class/net/*; do
		if [ ! -f "${device}/flags" ]; then
			echo "*** ${device}/flags missing"
			continue
		fi
		flags="$(cat "${device}/flags")"
		echo "*** ${device}/flags = $flags";
		if [ "$((flags & 1))" -ne 0 ]; then
			printf "*** ${device}/carrier = "
			cat "${device}/carrier"
		fi;
	done
}
```

Can you call log_flags before and after the _set_available_devices_to_up
call and also directly before the dhcpcd call?

Once you collected the logs, can you add a "wait_for_udev 10" call after
the _set_available_devices_to_up and collect the logs again?

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to initramfs-tools in Ubuntu.
https://bugs.launchpad.net/bugs/2065037

Title:
  dhcpcd is called before interfaces have carrier causing a 29 seconds
  boot delay

Status in initramfs-tools package in Ubuntu:
  New

Bug description:
  In automatically encrypted Clevis+Tang unlock of LUKS encrypted device
  (dmcrypt/cryptsetup) - on top of which the ZFS Pool for / resides,
  dhcpcd is used in order to obtain automatically an IP address during
  initramfs boot.

  During this phase, dhcpcd is called before interfaces have carrier
  causing a 29 seconds boot delay.

  Boot delay is currently 45 seconds, instead of the 15 seconds that it
  should.

  BUG Initially reported in:
  https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/2064926

  Relevant Logs:
  ```
  dhcpcd-10.0.6 starting
  [...]
  no interfaces have a carrier
  exiting due to oneshot
  dhcpcd exited
  Sleeping 29 seconds before retrying getting a DHCP lease
  dhcpcd-10.0.6 starting
  ```

  A possible workaround would be to manually edit /usr/share/initramfs-tools/scripts/functions
  Changing this:
  `for ROUNDTTT in 30 60 90 120; do`

  To this:
  `for ROUNDTTT in 5 5 5 5; do`

  But the proper solution would be to continuously "scan" the state of
  the Interface (every Second or so), and wait until the interface is
  UP, before deciding to call dhcpcd.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/2065037/+subscriptions




More information about the foundations-bugs mailing list