Fix launchctl bootstrap failures being discarded as XPC errors - #2045
Fix launchctl bootstrap failures being discarded as XPC errors#2045rogerneal wants to merge 1 commit into
Conversation
|
Thanks for picking this up @rogerneal, and for being clear about what you did and I checked out Three things I would raise: The commit is unsigned. I would split the domain change out. The issue proposes two fixes, and this PR If the domain change stays, the rest of the code may not agree with it. Two small ones while I am here: I think the core idea is okay, and it matches what |
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
f8d17d2 to
cde7f88
Compare
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)