systemd is the init system and service manager used by the majority of modern Linux distributions, running as PID 1 and managing the entire lifecycle of processes, sockets, timers, mounts, and more from boot to shutdown. It replaces SysVinit and Upstart by expressing system configuration as declarative unit files — INI-style text files that define services, timers, sockets, and other resources. The critical mental model is that everything in systemd is a unit, the dependency graph between units determines boot order and parallelization, and a single misconfigured After= or Wants= line can silently reorder startup in non-obvious ways — making systemd-analyze critical-chain an essential troubleshooting tool.
What This Cheat Sheet Covers
This topic spans 19 focused tables and 228 indexed concepts, 180 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: systemctl Service Control Commands
systemctl is the primary interface for controlling services and other units at runtime. These commands operate on a running system immediately but do not persist behavior across reboots unless combined with enable.
| Command | Example | Description | |
|---|---|---|---|
systemctl start nginx.service | • Starts a unit immediately • does not enable it to start at boot | ||
systemctl stop nginx.service | Stops a running unit immediately. | ||
systemctl restart nginx.service | • Stops then starts a unit • works even if the unit was not running | ||
systemctl reload nginx.service | Sends the unit's ExecReload= command to reload config without stopping the process. | ||
systemctl reload-or-restart nginx.service | • Reloads if the unit supports it • falls back to full restart if it does not | ||
systemctl status nginx.service | Shows active state, recent journal entries, PID, cgroup, and runtime info. | ||
systemctl is-active nginx.service | • Prints active or inactive• exits 0 if active — useful in scripts | ||
systemctl is-enabled nginx.service | • Prints enabled, disabled, or masked• exit code reflects the state | ||
systemctl is-failed nginx.service | • Exits 0 if the unit is in a failed state • useful in monitoring scripts | ||
systemctl try-restart nginx.service | • Restarts a unit only if it is currently running • silently does nothing if stopped | ||
systemctl try-reload-or-restart nginx.service | Reloads or restarts the unit only if it is currently running. |