mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
nuageinit: fix support on OpenStack
Change added in 90a7728cd8 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
This commit is contained in:
1 parent
ee18cb0710
commit
13d5f20e5b
1 file changed
+6
-8
@@ -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
|
||||
;;
|
||||
*)
|
||||
|
||||
Reference in new issue
Block a user