Skip to content

Commit

Permalink
fix: vehicle sim userdata should wait on apt lock (#13)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <salamida@amazon.com>
  • Loading branch information
fsalamida and github-actions authored Jun 21, 2022
1 parent b884d41 commit c91bdcc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/integ.full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,20 @@ export class IntegTesting {
const userData = `\
set -euo pipefail
# Wait for any existing package install to finish
i=0
while true; do
if sudo fuser /var/{lib/{dpkg,apt/lists},cache/apt/archives}/lock >/dev/null 2>&1; then
i=0
else
i=\`expr $i + 1\`
if expr $i \>= 10 > /dev/null; then
break
fi
fi
sleep 1
done
# Upgrade system and reboot if required
apt update && apt upgrade -y
if [ -f /var/run/reboot-required ]; then
Expand Down

0 comments on commit c91bdcc

Please sign in to comment.