Skip to content

Commit

Permalink
Fix failure to obtain the lock (#338)
Browse files Browse the repository at this point in the history
Signed-off-by: samuelarogbonlo <[email protected]>
  • Loading branch information
samuelarogbonlo authored Nov 9, 2023
1 parent b45ce75 commit 9a4ac73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions terraform/modules/daily_snapshot/service/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ cloud-init status --wait
# Setting DEBIAN_FRONTEND to ensure non-interactive operations for APT
export DEBIAN_FRONTEND=noninteractive

# Use APT specific mechanism to wait for the lock
apt-get -qqq --yes update
apt-get -qqq --yes install -y ruby ruby-dev anacron awscli
# Using timeout to ensure the script retries if the APT servers are temporarily unavailable.
timeout 10m bash -c 'until apt-get -qqq --yes update && \
apt-get -qqq --yes install ruby ruby-dev anacron awscli; do sleep 10; \
done'

# Install the gems
gem install docker-api slack-ruby-client
Expand Down
7 changes: 4 additions & 3 deletions terraform/modules/sync_check/service/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ cloud-init status --wait
# Setting DEBIAN_FRONTEND to ensure non-interactive operations for APT
export DEBIAN_FRONTEND=noninteractive

# Use APT specific mechanism to wait for the lock
apt-get -qqq --yes update
apt-get -qqq --yes install -y ruby ruby-dev gcc make
# Using timeout to ensure the script retries if the APT servers are temporarily unavailable.
timeout 10m bash -c 'until apt-get -qqq --yes update && \
apt-get -qqq --yes install ruby ruby-dev gcc make; do sleep 10; \
done'

gem install slack-ruby-client sys-filesystem

Expand Down

0 comments on commit 9a4ac73

Please sign in to comment.