Skip to content

Commit fc6e6c8

Browse files
authored
Improve network and DNS readiness checks in installToolkit.sh
Enhanced network readiness checks to include DNS resolution.
1 parent 6138a0e commit fc6e6c8

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

OCIWorkVMStack/scripts/installToolkit.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
#cloud-config
22
runcmd:
33
- |
4-
echo "Waiting for network..."
4+
echo "Waiting for network + DNS..."
5+
# 1. Basic network (L3)
56
until ping -c1 8.8.8.8 >/dev/null 2>&1; do
6-
echo "Network not ready, retrying in 10 seconds..."
7-
sleep 10
7+
echo "Network not ready..."
8+
sleep 5
89
done
9-
echo "Network ready, starting..."
10+
# 2. Wait for OCI DNS resolver to be configured
11+
until grep -q "169.254.169.254" /etc/resolv.conf 2>/dev/null; do
12+
echo "DNS resolver not ready..."
13+
sleep 3
14+
done
15+
# 3. Wait for DNS resolution to actually work
16+
until getent hosts yum.oracle.com >/dev/null 2>&1; do
17+
echo "DNS not resolving..."
18+
sleep 5
19+
done
20+
echo "Network + DNS ready, starting..."
1021
username=cd3user
1122
logfile="/$username/mount_path/installToolkit.log"
1223
toolkit_dir="/tmp/githubCode"

0 commit comments

Comments
 (0)