Pcornel
Linux · Linux Troubleshooting

Service Failure

Cheat sheet · https://pcornel.dk/topic.php?topic=2912

Back to the Topic

Answer

A service failure is a systemd service that fails to start, exits, or restarts in a loop.

Remember

Read the journal for the first error. Typical causes: config error, port in use, missing file or permission, wrong user, dependency not ready, SELinux denial.

First checks

  • journalctl -b -p err — errors this boot
  • systemctl --failed — failed units
  • df -h; df -i — space and inodes
  • ss -tulpn — listening sockets
  • dmesg -T | tail — recent kernel messages

Commands

systemctl status <service> --no-pager
Bounded read-only observation/validation for unit load state, active/substate, process status, recent unit log lines an…
show -p
systemctl status <unit> --no-pager -l
journalctl -u <unit> -b
systemctl cat <unit>
systemctl show <unit> -p ExecStart,User,Environment
sudo -u <user> <ExecStart command>
journalctl -k -g apparmor
systemctl list-dependencies <unit>
systemctl reset-failed

Verify in this order

unit starts → ExecStart runs → process stays up → service answers

Where it usually breaks

First mismatch in persistent intent → provider/parser/generator → kernel/userspace runtime → dependency/security context → logs/counters → consumer-visible read-back; 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=2912

Confirmation

Confirm action

Continue?