Expand description
Boot persistence on macOS (ARCHITECTURE.md §3): register the daemon
as a launchd user agent so the lease is a system guarantee across
reboots and crashes. If registration is refused, stackless degrades
loudly — status/list read the reason from daemon.persistence
and warn that leases hold only while the daemon happens to run.
KeepAlive is { SuccessfulExit = false }: launchd restarts a crash
but honors a clean drain, so daemon stop and the upgrade handshake
(§3) still take the daemon down for good.
Constants§
Functions§
- degradation_
warning - The degradation warning for
status/list—Nonewhen persistence is registered (the steady state),Some(line)when it is degraded. - ensure_
registered - Ensure the LaunchAgent exists and is bootstrapped. Records the
outcome to
daemon.persistenceand never fails the daemon: a refused registration degrades loudly rather than aborting (§3). - kickstart_
if_ supervised - Start the daemon under launchd supervision, returning
trueonly when it actually ran the service vialaunchctl kickstart. - persistence_
status_ path - The one-line file
status/listread: “registered” on success, the failure reason otherwise. - service_
registered - Whether launchd currently knows our service in the caller’s gui
domain — the live fact, unlike the
daemon.persistencefile, which only records the outcome of the last daemon startup.