Systemd Cheatsheet - Systemd Service Management Command Reference

Even if all you know is systemctl start or stop, it is worth walking through this set — it is the standard way to manage services on systemd distributions. Beyond start/stop and boot-enabling, it covers targeted journal log queries, timer scheduling, resource caps, and the control-group unit tree, answering three common questions: why a service fails to start, where to find its logs, and how to cap CPU or memory.

SysOps·47 commands·Last updated 2026-07-21
systemdsystemctljournalctlServices

Service Management 8

systemctl start nginx
Start the service into the running state; does not add it to boot-enable, so it goes away on reboot
systemctl stop nginx
Stop the running service, running its ExecStop before exit; does not touch whether it is enabled at boot
systemctl restart nginx
Stop then start again; drops active connections, so prefer reload when the process holds persistent sessions
systemctl reload nginx
Gracefully reload config without dropping connections; not all services support reload
systemctl enable nginx
Enable the service to start at boot; add --now to also start it immediately
systemctl disable nginx
Disable the service from starting at boot
systemctl enable --now nginx
Enable at boot and start immediately
systemctl mask nginx
Fully disable a service so it cannot be started manually or pulled in by other units

Status 7

systemctl status nginx
Show service state and recent logs (most common)
systemctl is-enabled nginx
Show whether the service is enabled at boot
systemctl is-active nginx
Show whether the service is currently running
systemctl is-failed nginx
Check whether the service is in a failed state
systemctl list-units --type=service
List all loaded service units
systemctl list-unit-files --type=service
List all installed service files and their boot-enable state
systemctl list-units --failed
List failed services to troubleshoot startup errors

journalctl 8

journalctl -u nginx
Show logs for the specified service
journalctl -u nginx -f
Follow the service's logs in real time
journalctl --since "10 min ago" -u nginx
Show logs from the last 10 minutes
journalctl --since today --until "1 hour ago"
Filter logs by a time range
journalctl -p err -b
Show logs at error level and above since boot
journalctl -u nginx -n 100 --no-pager
Show the last 100 log lines without paging
journalctl --disk-usage
Show how much disk space journal logs use
journalctl --vacuum-size=100M
Vacuum logs, keeping only the most recent 100 MB

Targets & Runlevels 6

systemctl get-default
Show the default boot target (equivalent to the runlevel)
systemctl set-default multi-user.target
Set the default to multi-user (command-line) mode
systemctl set-default graphical.target
Set the default to graphical desktop mode
systemctl isolate multi-user.target
Switch to multi-user mode immediately (equivalent to init 3)
systemctl rescue
Enter rescue mode (requires root; stops non-essential services)
systemctl list-units --type=target
List all currently active targets

Timers 6

systemctl list-timers
List all scheduled timers (replaces crontab -l)
systemctl list-timers --all
List all timers, including inactive ones
systemctl status <timer>
Show a timer's state and next execution time
systemctl start <timer> && systemctl enable <timer>
Enable a timer and start it at boot
systemctl cat <timer>
Show the timer unit file contents
journalctl -u <timer>
Show logs of the service triggered by the timer

Service Config & Resource Control 6

systemctl cat nginx
Show the service's unit file contents
systemctl edit nginx
Edit a service override config, stored in override.conf
systemctl edit --full nginx
Edit the full unit file (not as an override)
systemctl daemon-reload
Reload systemd configuration after editing unit files
systemctl set-property nginx CPUQuota=50%
Limit the service to at most 50% CPU
systemctl set-property nginx MemoryMax=512M
Cap the service's memory at 512 MB

Troubleshooting & Analysis 6

systemctl --failed
Quickly show all failed services
systemctl reset-failed nginx
Clear the failed state of a service
systemd-analyze time
Show total boot time
systemd-analyze blame
List each service's startup time, sorted by duration
systemd-analyze critical-chain nginx
Show the startup dependency chain for a service
systemctl daemon-reload
Required after editing unit files, otherwise config won't take effect

Tips

  • reload gracefully reloads config without dropping connections, while restart recreates the process. Not all services support reload — nginx does.
  • journal logs rotate by default; if --disk-usage is too large, clean up with journalctl --vacuum-size=100M.
  • Timers are more controllable than crontab: you can see execution logs in journalctl and they support dependency relationships.
  • You must run systemctl daemon-reload after editing a unit file, otherwise systemd won't read the new config.
  • systemctl edit creates an override.conf snippet that doesn't modify the original unit file — safer.
  • mask is more thorough than disable: a masked service cannot be started manually or indirectly. Mask it before uninstalling a service.

Official References

Each command links to its official documentation below, so you can verify the latest usage and read deeper.

Maintained by LaoHand

Publicly updated on Jul 21, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us