From 0d5f48b116bde8b1eafb31829299a94f8d507aca Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 9 Dec 2022 13:05:10 -0500 Subject: [PATCH] Be more patient and more noisy about DHCP attempt over time --- .../lib/dracut/hooks/cmdline/10-confluentdiskless.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/confluent_osdeploy/el8-diskless/initramfs/usr/lib/dracut/hooks/cmdline/10-confluentdiskless.sh b/confluent_osdeploy/el8-diskless/initramfs/usr/lib/dracut/hooks/cmdline/10-confluentdiskless.sh index b90729e2..98c8eaf0 100644 --- a/confluent_osdeploy/el8-diskless/initramfs/usr/lib/dracut/hooks/cmdline/10-confluentdiskless.sh +++ b/confluent_osdeploy/el8-diskless/initramfs/usr/lib/dracut/hooks/cmdline/10-confluentdiskless.sh @@ -110,6 +110,11 @@ if [ ! -z "$confluentsrv" ]; then ifname=$(ip -br link|grep LOWER_UP|grep -v UNKNOWN|head -n 1|awk '{print $1}') echo -n "Attempting to use dhcp to bring up $ifname..." dhclient $ifname + while ! ip -br addr show dev $ifname | grep \\ . > /dev/null; do + echo -n "Still waiting for IPv4 address on: " + ip -br link show dev $ifname + sleep 1 + done echo -n "Complete: " ip -br addr show dev $ifname DIDDHCP=1 @@ -204,6 +209,11 @@ if [ "$autoconfigmethod" = "dhcp" ]; then if [ "$DIDDHCP" = "0" ]; then echo -n "Attempting to use dhcp to bring up $ifname..." dhclient $ifname + while ! ip -br addr show dev $ifname | grep \\ . > /dev/null; do + echo -n "Still waiting for IPv4 address on: " + ip -br link show dev $ifname + sleep 1 + done echo -n "Complete: " ip -br addr show dev $ifname fi