Thank you, Quinn. Your explanation resolves my startup-race question. I understand that launchd's cleanup depends on the worker remaining in the job's process group.
To clarify the XPC question: I meant terminating the worker/service, not having it terminate the application. My existing controller normally performs worker termination. If that controller becomes wholly unresponsive, it cannot do so; there is no independent watchdog in my current design. I therefore distinguish controller death from controller hang and am prioritising the launchd-managed controller route.
The qualification worker I am evaluating is fixed-purpose, sandboxed, and does not need to create descendants. My target remains macOS 15.6 on Apple silicon. Four remaining platform points would help me avoid choosing an unsupported arrangement:
Completion after controller loss
What supported observation can I use in a later verification step to establish that the worker from a particular job execution has exited, including when the controller died before recording its identity?
Is there a public completion interface, with particular privilege or registration requirements, or only the documented group-cleanup assurance?
I would not treat PID/PGID disappearance or parsing launchctl print as proof.
A living but hung controller
I understand that launchd has no general hard wall-clock runtime limit.
Does macOS 15.6 offer an OS-managed liveness or lease mechanism that can initiate termination when an ordinary job stops participating, without another application-created watchdog?
I mean initiating termination, not guaranteeing completion within a deadline.
Enforced confinement on macOS 15.6
Following your group-escape warning, is there a supported unprivileged restriction that prevents this worker from changing its inherited process group/session or creating descendants, without Endpoint Security or custom sandbox profiles?
I distinguish that from merely reviewing my code to ensure it does not perform those operations.
Non-GUI launch context
Your login answer addressed a conventional GUI application.
As a prospective alternative, could a genuinely non-GUI, signed App Sandbox worker run under a dedicated Standard account before its first GUI login?
If supported, which launchd domain/session and sandbox-container initialization prerequisites apply?
A reference to the applicable public interface, or confirmation that a particular facility is unavailable, would be sufficient.
I understand that filesystem effects and cleanup verification would remain my responsibility.
Thank you.
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags: