fix(examples): disable background apt services in multi-runner user-data#5141
Open
alexjurkiewicz wants to merge 1 commit into
Open
fix(examples): disable background apt services in multi-runner user-data#5141alexjurkiewicz wants to merge 1 commit into
alexjurkiewicz wants to merge 1 commit into
Conversation
Disable unattended-upgrades, apt-daily.service and apt-daily-upgrade.service. They can interfere with user-data dependency installation causing errors like: E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 5381 (apt-get) Can't install dotnet core dependencies. Also, wait for the dpkg lock to release before trying to install anything.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ubuntu's `unattended-upgrades`, `apt-daily.service`, and `apt-daily-upgrade.service` start in the background shortly after a fresh instance boots and can hold `/var/lib/dpkg/lock-frontend`. The runner installer (`install_runner.sh` → `installdependencies.sh`) runs `apt-get` to install .NET Core dependencies; if a background service holds the lock at that moment the install fails:
Without `set -e`, the runner starts with missing dependencies. With `set -e` (a common hardening practice), the entire user-data script exits — the runner is never installed or registered, and queued jobs wait indefinitely until job-retry exhausts its attempts.
This PR stops and masks those services before any `apt-get` operations, then waits for any in-flight lock holder to release.