LinuxJunior
A systemd service failed to start
When a systemd unit fails, systemctl status shows the state and the last log lines. Read the journal for that unit, fix it, then reset the failed state.
What you see
systemctl status NAMEshowsfailed- The service starts and then stops again
What it means
systemd keeps a state for every unit. A unit in the failed state tried to run and did not succeed. The exit reason and the program's own output are in the journal.
How to confirm the cause
- 1See the state and the last log lines
systemctl status NAME
Read the
Active:line and the log lines under it. - 2Read the unit's logs from this boot
journalctl -u NAME -b
-ufilters by unit and-blimits to the current boot. Add-p errto show errors only. - 3List everything that failed
systemctl --failed
Lists units in the failed state.
- 4Script-friendly check
systemctl is-failed NAME
Returns success if the unit is in the failed state.
Causes and fixes
Bad command, path or permissions in the unit
- HOW TO TELL
- The status output shows the process exiting immediately, or a message about the executable.
- FIX
- Correct
ExecStart=and the user or permissions it runs under. After editing a unit file, reload systemd and start it again.sudo systemctl daemon-reload sudo systemctl start NAME
The application itself crashed
- HOW TO TELL
- The journal for the unit shows the application's own error.
- FIX
- Fix what the application reports, such as a missing config file or a port already in use.
A dependency is not running
- HOW TO TELL
- The unit refuses to start because another unit it needs failed.
- FIX
- Run
systemctl statuson the dependency and fix it first.
How to stop it coming back
- Test a new unit with
systemctl statusandjournalctl -uright after you create it. - Keep one fix per change so the cause stays clear.
Keep going
- Runbook: Address already in use (port is taken)
- Runbook: No space left on device
- Cheat sheet: systemctl
- Cheat sheet: journalctl
- Lesson: the linux topic in Learn
Sources
Linux man-pages (man7.org) and the systemd manual (freedesktop.org), read 18 Nov 2026. Command options were checked against those pages.