git: cfd1ade5c712 - stable/15 - nuageinit: support fetching configuration on multiple iface
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 05 Feb 2026 14:09:53 UTC
The branch stable/15 has been updated by bapt:
URL: https://cgit.FreeBSD.org/src/commit/?id=cfd1ade5c7125eda8d055d896004a18fc33b961d
commit cfd1ade5c7125eda8d055d896004a18fc33b961d
Author: Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2026-01-29 09:56:33 +0000
Commit: Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2026-02-05 14:09:50 +0000
nuageinit: support fetching configuration on multiple iface
On some environement a VM can be connected to multiple ifaces but only
one will respond to dhcp and able to fetch the metadata.
Launch the early dhclient on all available ifaces and as soon as one
dhcp has successfully configured an iface, proceed with fetching the
metadata.
MFC After: 1 week
Reported by: mateusz.klejn@ovhcloud.com
Tested by: mateusz.klejn@ovhcloud.com
Sponsored by: OVHcloud
(cherry picked from commit 90a7728cd8905cd26b90d06f7873df8bad43ae9a)
---
libexec/rc/rc.d/nuageinit | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/libexec/rc/rc.d/nuageinit b/libexec/rc/rc.d/nuageinit
index c901971488bd..259ce3c138e5 100755
--- a/libexec/rc/rc.d/nuageinit
+++ b/libexec/rc/rc.d/nuageinit
@@ -56,10 +56,15 @@ nuageinit_start()
OpenStack*)
mkdir -p /media/nuageinit/openstack/latest
ifaces=$(ifconfig -l ether)
- set -- $ifaces
- dhclient -p /tmp/ephemeraldhcp.pid $1
+ for iface in $ifaces; do
+ dhclient -p /tmp/ephemeraldhcp.$iface.pid $iface
+ done
+ pids=$(cat /tmp/ephemeraldhcp.*.pid)
+ left=$(pwait -op $pids 2>/dev/null)
+ for iface in $left; do
+ kill -15 $left
+ done
fetch_openstack
- pkill -F /tmp/ephemeraldhcp.pid
citype=config-2
;;
*)