Skip to content

(maint) wait for systemd before apt-get update on Debian and Ubuntu - #306

Open
albatrossflavour wants to merge 2 commits into
mainfrom
wait-for-systemd-on-debian
Open

albatrossflavour wants to merge 2 commits into
mainfrom
wait-for-systemd-on-debian

Conversation

@albatrossflavour

@albatrossflavour albatrossflavour commented Dec 1, 2026 •

Copy link
Copy Markdown

The docker task now waits for systemd on Debian and Ubuntu as it already did on EL. Started with the task's own docker run flags, Ubuntu 22.04 failed apt-get update with "Unknown error executing apt-key" in 14 of 15 local runs without the wait and none with it.

The docker task only waited for systemd to finish starting on EL containers. On a litmusimage Ubuntu 22.04 container started the way this task starts it, apt-get update during boot fails in about 14 of 15 runs. The errors are "Unknown error executing apt-key" and "jammy-security InRelease is not signed". Once systemd is running it didn't fail in 15.

The wait is now a function both branches call. It gives up after a minute, so a container whose systemd never settles doesn't hang the provision.
@albatrossflavour
albatrossflavour requested a review from a team as a code owner December 1, 2026 01:33
@codecov-commenter

codecov-commenter commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.50%. Comparing base (4b444d8) to head (30e294e).

❗ There is a different number of reports uploaded between BASE (4b444d8) and HEAD (30e294e). Click for more details.

HEAD has 19 uploads less than BASE
Flag BASE (4b444d8) HEAD (30e294e)
20 1
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #306      +/-   ##
==========================================
- Coverage   91.42%   81.50%   -9.93%     
==========================================
  Files           7        8       +1     
  Lines         525      638     +113     
==========================================
+ Hits          480      520      +40     
- Misses         45      118      +73     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…temd by PID 1's name, with specs for the task

Inside [[ ]], > compares strings, so the 20-poll minimum was really 3, and
from 100 to 199 the loop couldn't exit. It now uses -gt. PID 1 is matched by
/proc/1/comm instead of the binary's path, which differs on images without a
merged /usr. The task returns before its main code when it isn't the program
being run, as lxd.rb does, so spec/tasks/docker_spec.rb can load it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants