Bootstrap into system domain as root outside Aqua - #2058
Open
rogerneal wants to merge 2 commits into
Open
Conversation
Surface launchctl exit status and stderr from ServiceManager.register instead of continuing into a misleading apiserver XPC error. Keep container system start idempotent when the service is already registered. The system-domain bootstrap change for root outside Aqua is intentionally left to a follow-up so this can merge on its own evidence. Fixes apple#2008
When euid is 0 and the session is not Aqua, bootstrap launchd services into the system domain instead of user/0 or gui/0. Align status, stop, and registration idempotency with that domain. Related to apple#2008 and apple#1514.
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.
Summary
euid == 0) outside an Aqua session, bootstrap into thesystemdomain instead ofuser/0orgui/0.isRegistereduseslaunchctl printfor domain-qualified targetsSystemStatuschecksdomain/labelregisteridempotency queries the same domain it bootstrapped intoSystemStopcompares bare labels fromenumeratecorrectly before re-qualifying for bootoutStacked on #2045. Related to #2008 and #1514.
Test plan
Tested
systemdomain selectionNot tested
macos-26reproduction:sudo container system start --enable-kernel-installXPC connection error: Connection invalidcontainer system statusreports registered/running in the same sudo/root contextcontainer system startremains idempotentPlease merge #2045 first; this branch is based on it.