Skip to content

systemd for Mere Mortals

systemd is the program that starts your Linux system and minds everything running on it: services, timers, mounts, logs. It's PID 1 — the first process the kernel starts, and the parent of all others. This guide explains the parts a mortal actually touches: writing a service, keeping it alive, reading its logs, scheduling with timers, and figuring out why one won't start.

This guide assumes you use a terminal on a Linux machine and have edited a config file before. Everything systemd-specific — units, journals, targets — is explained from zero.

What this guide covers

What it doesn't cover

Writing C against systemd APIs, containers under systemd (nspawn, quadlet), socket activation in depth, and the decades-old init wars — why systemd won is history; how to use it is this guide.

How to use this guide

Every unit, command, and failure in this guide was run for real on systemd 255 (Ubuntu 24.04): a demo service was started, killed, restarted by its policy, and stopped; a crash-looping service was watched until systemd gave up on it; a timer fired on schedule; and a sandboxed service's blocked writes were verified in its journal. Per-user services (systemctl --user) couldn't run in the test environment (no user manager session), so that section is marked (documented).


Part of the series

This guide is one of the For Mere Mortals guides: plain-language guides to the tools programmers and makers use.

Related guides:

License

The writing in this guide is licensed under CC BY 4.0. Code examples and lab scripts are licensed under the MIT License.