Glossary
launchd
The first userland process on macOS. PID 1, the init system, the service manager, and the only thing that can spawn daemons and agents.
launchd is the very first userspace process started by the kernel — PID 1. It is simultaneously:
- The init system (the thing the kernel
execs after boot). - The service manager (the thing that loads daemons, agents, and XPC services).
- The socket and event activator (it can hold a listening socket and start a daemon on first connection).
Apple open-sourced the original launchd at apple-oss-distributions/launchd, though the project hasn't been updated there in some time — modern macOS uses an internal evolution. The open repo is still useful for understanding the design.
Service definitions live as plists under /System/Library/LaunchDaemons/, /Library/LaunchDaemons/, and per-user ~/Library/LaunchAgents/. Tools that interact with launchd: launchctl (the CLI), and increasingly systemctl-style wrappers exposed by Apple's developer tools.
Crucially, launchd is the source of the jetsam priority bands — it tells the kernel which processes get killed first when memory pressure hits.