Skip to content

Commit

Permalink
adding retry logic on yum commands to avoid resource locking
Browse files Browse the repository at this point in the history
  • Loading branch information
b-jhoreman committed Apr 9, 2024
1 parent df91955 commit f2ae7c1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions pkg/deploy/generator/scripts/rpVMSS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ echo "setting ssh password authentication"
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
systemctl reload sshd.service

echo "running RHUI fix"
yum update -y --disablerepo='*' --enablerepo='rhui-microsoft-azure*'
#Adding retry logic to yum commands in order to avoid stalling out on resource locks
for attempt in {1..5}; do
echo "running RHUI fix"
yum update -y --disablerepo='*' --enablerepo='rhui-microsoft-azure*'
if [[ ${attempt} -lt 5 ]]; then sleep 10; else exit 1; fi
done

echo "running yum update"
yum -y -x WALinuxAgent -x WALinuxAgent-udev update --allowerasing
for attempt in {1..5}; do
echo "running yum update"
yum -y -x WALinuxAgent -x WALinuxAgent-udev update --allowerasing
if [[ ${attempt} -lt 5 ]]; then sleep 10; else exit 1; fi
done

echo "extending partition table"
# Linux block devices are inconsistently named
Expand Down

0 comments on commit f2ae7c1

Please sign in to comment.