Kelly Mears

Daemon

A long-running background process managed by the operating system's service supervisor.

Systems & Tooling1 min read198 words10 out · 4 in
also calledBackground serviceLaunch agent

A daemon is a program that runs in the background rather than attached to a session, typically started and supervised by the operating system: systemd on Linux, launchd on macOS, the service manager on Windows.

Supervision is the feature and the complication. A supervisor can restart a service when it exits unexpectedly, which turns an occasional crash into an invisible blip — genuinely useful when an underlying framework is unreliable. It also means the process cannot simply be killed: a signal reads as a crash and triggers a restart, so stopping it requires either a clean exit or unloading the job from the supervisor.

Registration is where the subtle failures live. A supervisor records the path it was told about, and if that path was captured in an unusual context — a sandboxed shell with a remapped home directory, for example — the record points at somewhere that does not exist. Every subsequent launch then fails, silently and quickly, and the fix requires clearing the registration rather than reinstalling the program. Registering from a normal launch, rather than by executing the binary directly, avoids the whole class of problem.

Scheduled work is the daemon's near relative; see Cron.

See also4

Hand-picked in the note itself — the neighbours worth reading next.

Related6

Nearby in the graph rather than deliberately chosen. Looser, sometimes surprising.

Linked from4

Notes elsewhere in the wiki that reach for this one.