Skip to content
statance
MenuClose
← All troubleshooting guides

A systemd service has failed

Linux

List failed units with systemctl --failed, then read the reason with systemctl status UNIT and journalctl -u UNIT -n 100. The status shows the exit code or signal; the journal usually shows the actual error, such as a config syntax error, a port already in use or a missing file.

Symptoms

  • systemctl --failed lists one or more units
  • A website or API stops responding after a reboot or deploy
  • Service status shows “failed (Result: exit-code)” or “start-limit-hit”

How to diagnose it

  1. List failed units

    Shows every unit in a failed state.

    systemctl --failed
  2. Read the status

    Main PID, exit code and the last log lines.

    systemctl status UNIT
  3. Read the full log for the unit

    -b limits to the current boot.

    journalctl -u UNIT -b -n 100 --no-pager
  4. Test the config

    Many services can validate their config without starting.

    sudo nginx -t sudo apachectl configtest sudo sshd -t
  5. Check the unit file

    Look for wrong ExecStart paths, users or working directories.

    systemctl cat UNIT

Common causes and fixes

Config syntax error

Fix the error the config test reports, then start the service.

sudo systemctl restart UNIT

Port already in use

Find what holds the port with ss -ltnp and stop the conflicting process.

Crash loop hit the start limit

After fixing the cause, reset the failure counter.

sudo systemctl reset-failed UNIT && sudo systemctl start UNIT

Killed by the OOM killer

Status shows Result: oom-kill. See the OOM killer guide.

Unit edited but not reloaded

Reload systemd after changing unit files.

sudo systemctl daemon-reload

Prevent it happening again

  • Alert when SERVICES_failed is above 0.
  • Add Restart=on-failure and RestartSec=5 to service units that should recover on their own.
  • Add an HTTP or TCP check for the service so you know when users are affected.

Set it up: Linux monitoring · Ubuntu monitoring · CentOS, RHEL, Rocky & Alma monitoring.

FAQ

How do I see why a systemd service failed?

Run journalctl -u UNIT -b -n 100. systemctl status UNIT shows the exit code and the last few lines.

What does start-limit-hit mean?

The unit failed too many times in a short period and systemd stopped retrying. Fix the cause, then run systemctl reset-failed UNIT.

Related guides

Get alerted before this becomes an outage.

Install the agent in one line. Statance watches CPU, memory, disk and services, and its AI assistant helps find the cause.