The branch main has been updated by bapt:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=13d5f20e5b9ecb42ecf7de4e98d5af0bd5d63c82

commit 13d5f20e5b9ecb42ecf7de4e98d5af0bd5d63c82
Author:     Adam Mizerski <[email protected]>
AuthorDate: 2026-09-16 13:40:15 +0000
Commit:     Baptiste Daroussin <[email protected]>
CommitDate: 2026-09-17 15:32:37 +0000

    nuageinit: fix support on OpenStack
    
    Change added in 90a7728cd8905cd26b90d06f7873df8bad43ae9a contained a
    lot of bugs:
    - If all network interfaces correctly respond to DHCP, then pwait was
    waiting forever.
    - If there was more than 1 interface, then "cat
    /tmp/ephemeraldhcp.*.pid" joined pid numbers into one long string.
    - "for iface in $left; do kill -15 $left; done" is not using $iface.
    
    Tested by:      [email protected]
    Sponsored by:   OVHcloud
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/2436
---
 libexec/rc/rc.d/nuageinit | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/libexec/rc/rc.d/nuageinit b/libexec/rc/rc.d/nuageinit
index e2f0a85bc3bc..43476a71c9eb 100755
--- a/libexec/rc/rc.d/nuageinit
+++ b/libexec/rc/rc.d/nuageinit
@@ -55,16 +55,14 @@ nuageinit_start()
                case "$product" in
                OpenStack*)
                        mkdir -p /media/nuageinit/openstack/latest
-                       ifaces=$(ifconfig -l ether)
-                       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
+                       for iface in $(ifconfig -l ether); do
+                               timeout 10s dhclient -p 
/tmp/ephemeraldhcp.$iface.pid $iface \
+                                       || rm -f /tmp/ephemeraldhcp.$iface.pid
                        done
                        fetch_openstack
+                       for pidfile in /tmp/ephemeraldhcp.*.pid; do
+                               pkill -F $pidfile
+                       done
                        citype=config-2
                        ;;
                *)

Reply via email to