Linux service failed to start: diagnose and fix it
A step-by-step systemd troubleshooting guide: check status, read the journal, fix the unit file, reload, and restart.
What this covers
When a systemd service won't start, the error message is usually vague. This guide walks you through diagnosing the real cause from systemd's own state and logs, then fixing the unit configuration and getting the service running and boot-enabled again.
Symptom
Check the service's state with systemctl status
Before changing anything, find out exactly what systemd knows about the service: whether it's loaded, active, enabled, and what error it printed last. The recent log lines at the bottom usually name the failing component (config error, missing file, port in use). You'll know you have the answer when you can state the active state (e.g. 'failed') and a plausible reason.
Inspect any systemd unit's loaded/enabled state, active state, main PID, and its most recent log lines in one command.
$ systemctl status nginxScan system-wide error logs since boot
If the status output doesn't make the cause obvious, look at error-priority messages from the whole boot. This catches problems the service itself doesn't log, like missing dependencies, permissions, or SELinux/AppArmor denials. Success looks like a short list you can scan for entries mentioning your service or its dependencies.
Filter the systemd journal to error-priority messages from the current boot, with timestamps, unit names, and full message text.
$ journalctl -p err -b --no-pagerWatch the service's logs live while retrying
For intermittent or crash-looping services, stream the unit's journal in real time, then restart the service in another terminal and watch what happens at the moment of failure. You'll know it's working when you see new timestamped entries appear the moment you retry.
journalctl -f -u UNIT streams new journal entries for one systemd service in real time, with timestamps and metadata.
$ journalctl -u nginx.service -fInspect the unit file and its overrides
Many startup failures come from a broken unit file or a stale drop-in override: a wrong ExecStart path, a bad Environment line, or a leftover override from an old install. View the full unit plus every override to spot anything suspicious, and use an override edit to correct it rather than editing vendor files. When the offending line is found and corrected (or removed), move on.
systemctl cat reveals a service's unit file plus every drop-in override; systemctl edit creates overrides without touching vendor files.
$ systemctl cat nginx.service▾ Undo
$ sudo systemctl revert nginx.service && sudo systemctl daemon-reloadReload systemd so your unit changes take effect
systemd caches unit files; edits on disk are ignored until you reload. Run the reload after any unit-file or drop-in change, otherwise you'll keep testing the old, broken configuration. It's done when systemd accepts the change with no output and no error.
Apply your edits to service files and drop-ins without rebooting.
$ sudo systemctl daemon-reloadRestart the service and read the result
With the cause addressed and units reloaded, do a full restart so the process starts fresh with the new configuration. If the service was already half-running, a restart avoids the confused state a plain start can leave. If it fails again, the status output now reflects the new attempt — take that error back to the diagnosis steps.
Restart a systemd service correctly: full restart, config-only reload, or restart-only-if-running.
$ systemctl restart nginx▾ Undo
$ systemctl start nginxMake sure the service starts at boot
A service that fails on every reboot but runs when started by hand is often simply not enabled. Enable it so it starts at boot and starts immediately in one step — useful once the underlying failure is fixed. Done when enable reports the symlink was created and the service is active.
Enable a systemd service to start at boot and start it immediately with one command.
$ sudo systemctl enable --now nginx▾ Undo
$ sudo systemctl disable --now nginxClear the failed state so monitoring stays clean
After a unit has failed and been fixed, it can stay marked 'failed' and keep alarms firing even though the service is healthy now. Clear the failed state, then confirm with systemctl status that the unit shows active (running). Verification is complete when the service is active, enabled, and no failed units remain.
systemctl reset-failed forgets units stuck in the 'failed' state so they no longer clutter status output and monitoring.
$ sudo systemctl reset-failedHow to confirm it worked
systemctl status shows the unit as 'active (running)' and enabled for boot, with no failed units left in the output.
Undo everything
Every command above can be reverted. Run these in order to undo all of it.
$ sudo systemctl disable --now nginx
systemctl start nginx
sudo systemctl revert nginx.service && sudo systemctl daemon-reloadReview before running — some steps may not be independent.
Sources
- Ubuntu Manpage: systemctl - Control the systemd system and service managerEvidence: "status [PATTERN...|URL...] Show terse runtime status information about one or more units ... This function is intended to generate human-readable output ... along with the most recent log data."
- systemctl(1) — Arch Linux manualEvidence: "status [PATTERN...|URL...] — Show terse runtime status information about one or more units, followed by most recent log data from the journal."
- journalctl(1) — Query the systemd journalEvidence: The manual documents '-p' / '--priority=' to filter by message priority (e.g. err) and '-b' / '--boot' to limit output to a specific boot.
- systemd/Journal - ArchWikiEvidence: The ArchWiki journal page shows filtering journalctl output by priority level and by current boot with examples like journalctl -p err -b.
- systemctl(1) - Linux manual pageEvidence: Documents 'systemctl daemon-reload': reload the systemd manager configuration, re-running generators and re-writing user session config.
Last verified: 2026-09-21
Related guides
A problem-fix walkthrough for a full Linux disk: find the culprit filesystem, remove space hogs, sweep caches, and verify the space came back.
A terminal-first workflow to diagnose high CPU usage on Linux, identify the responsible process or service, and fix it without losing your work.
SSH refuses to connect to your Linux server? Test the port, check sshd, open the firewall, and validate the config — in that order.