Fix launchctl bootstrap failures being discarded as XPC errors - #2045
Draft
rogerneal wants to merge 1 commit into
Draft
Fix launchctl bootstrap failures being discarded as XPC errors#2045rogerneal wants to merge 1 commit into
rogerneal wants to merge 1 commit into
Conversation
Surface launchctl stderr from ServiceManager.register, and bootstrap into the system domain when running as root outside an Aqua session. Co-authored-by: Cursor <cursoragent@cursor.com>
3 tasks
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
launchctl bootstrapexit status and stderr fromServiceManager.registerinstead of continuing into a misleading apiserver XPC error.euid == 0) outside an Aqua session, bootstrap into thesystemdomain instead ofuser/0orgui/0.container system startidempotent when the service is already registered.launchctlfailure path for error surfacing.Fixes #2008
Test plan
Tested
swift test --filter ServiceManagerTests(domain selection cases)launchctlfailure viaServiceManager.registerwith a missing plist; error includeslaunchctl bootstrapand statusbin/container system start --app-root ...:register()loadedcom.apple.container.apiserverintogui/<uid>and the process startedNot tested
macos-26reproduction:sudo container system startin a Background / non-login sessioncontainer system statusafter start in that CI environmentsudolaunchctl bootstrap systemon this developer machine (not available in the local session used for this PR)Suggested CI verification
On a
macos-26runner:sudo container system start --enable-kernel-installXPC connection error: Connection invalidcontainer system status(or another command that talks to the apiserver)