Thanks, Quinn. We tried your static-plist suggestion on macOS 27.0 (26A428)
in our Developer ID signed and notarized app:
A root-owned plist at /Library/LaunchAgents/<agent-label>.plist has
LimitLoadToSessionType=Background and
AssociatedBundleIdentifiers=<app-bundle-id>. It launches the nested
App Sandbox helper.
Our SMAppService system daemon calls
launchctl kickstart user/<serviceUID>/<agent-label>. It bootstraps that
fixed plist only if the job is not loaded in the service account's domain.
After a cold boot and FileVault unlock, the helper published readiness as
the hidden service account while /dev/console still belonged to root,
before GUI login.
Turning the app off in Background App Activity stopped the daemon. Its
control socket closed, so the helper exited; the agent job stayed loaded.
Turning the app back on started a new daemon and helper.
These are observations on one OS release. Is this static plist plus
kickstart arrangement within the intended launchd and Background Task
Management model for a hidden-account Background agent, including before
login? On disable or unregister, should our daemon leave the agent job loaded
and let the helper exit on socket EOF, removing the plist only on explicit
uninstall? We can file Feedback for system-wide SMAppService agent
registration if useful.
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags: