Keep app.slice loadable with private procfs - #6494
Open
mateuspim wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Conditionally enables app.slice OOM candidacy so hardened procfs configurations remain usable.
Changes:
- Adds and tests a compatibility-aware systemd user generator.
- Reloads existing user managers through migration.
- Updates packaging checks and layout documentation.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
default/systemd/user-generators/omarchy-oomd-generator |
Generates the OOM drop-in only when PID 1’s cgroup is readable. |
migrations/1785620124.sh |
Reloads user managers after upgrading. |
migrations/1785424256.sh |
Updates generator behavior comments. |
test/shell.d/systemd-test.sh |
Tests both procfs compatibility branches. |
test/shell.d/config-test.sh |
Enforces correct companion packaging. |
docs/file-layout.md |
Documents template and generator locations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Why
ManagedOOM*=killmakes a user unit unloadable when/procis mounted with a privacy policy such ashidepid=invisibleorhidepid=noaccess.systemd resolves the implicit
systemd-oomd.servicedependency throughcg_mask_supported(), which reads PID 1's cgroup from/proc/1/cgroup. With PID 1 hidden, that lookup returnsESRCHand unit loading fails with:Because D-Bus, PipeWire, UWSM app scopes, and other user units depend on
app.slice, this can prevent the graphical session from starting or leave launchers stuck at “Launching…”. The same failure affects every lingering user manager on the host.The procfs policy is useful hardening and should not need to be weakened to boot Omarchy.
What
app.sliceOOM drop-in only when/proc/1/cgroupis readable.app.sliceis eligible for OOM killing.Normal systems keep the OOM protection introduced in #6445. Hardened systems skip only the incompatible candidacy settings;
systemd-oomd.servicemay remain enabled harmlessly.Verified
ManagedOOMMemoryPressure=killorManagedOOMSwap=killcausesLoadState=errorunderhidepid=invisible.SYSTEMD_UNIT_PATH=/usr/lib/systemd/user systemd-analyze --user verify app.slicefails on the affected host.r1477tor1485, reloaded the user manager, and rebooted twice with the procfs hardening unchanged.app.slice../test/shell.d/systemd-test.shpasses../test/shellreaches the pre-existingbar icons share slot and baseline geometryfailure; tests before it pass.test/shell.d/config-test.shrequires the privateomarchy-pkgscheckout and will intentionally require the companion packaging update below.Companion packaging change
omarchy-settingsmust stop installing:The template remains under
/usr/share/omarchy/default/. Install the generator instead:install -Dm755 default/systemd/user-generators/omarchy-oomd-generator \ "$pkgdir/usr/lib/systemd/user-generators/omarchy-oomd-generator"