Skip to content

Commit

Permalink
Merge pull request #233 from MusicDin/fix/cloud-init-reboot
Browse files Browse the repository at this point in the history
images: Fix cloud-init check after reboot
  • Loading branch information
tomponline authored Jul 10, 2024
2 parents 630957e + f267715 commit fa3199b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/test-image
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,16 @@ if [ "${VARIANT}" = "cloud" ]; then
lxc exec "${name}" -- cloud-init status --wait --long

# If systemd is available, use it to wait for any other job to complete before the restart
lxc exec "${name}" -- systemctl is-system-running --wait || true
if lxc exec "${name}" -- test -d /run/systemd/system/; then
lxc exec "${name}" -- systemctl is-system-running --wait || true
fi

lxc restart "${name}"
waitInstanceReady "${name}"

# Give instance extra few seconds to boot properly.
sleep 10

# cloud-init status.
if lxc exec "${name}" -- cloud-init status --wait --long; then
echo "===> PASS: cloud-init reboot: ${name}"
Expand Down

0 comments on commit fa3199b

Please sign in to comment.