Units
Cheat sheet · https://pcornel.dk/topic.php?topic=2718
Answer
A systemd unit is anything systemd manages, named by type suffix: .service (daemon), .socket, .timer, .mount, .target (group), .path, .device and more. Units have state (active, inactive, failed) and can depend on each other.
Remember
Unit files live in /usr/lib/systemd/system (packages), /etc/systemd/system (admin, wins) and /run. Override with drop-ins (systemctl edit <unit>) instead of editing package files.
First checks
systemctl status <unit>— state, main PID, recent log linessystemctl list-units --failed— failed unitsjournalctl -u <unit> -b— the unit's log since bootsystemctl cat <unit>— unit file plus drop-inssystemd-analyze verify <unit>— unit file errors
Verify in this order
unit file loaded → dependencies resolved → unit started → active (or failed) → logged in the journal
Where it usually breaks
First mismatch in persistent unit/config/generator → dependency/order graph → systemd state → process/cgroup → socket/resource dependency → journal → consumer check; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2718