Linux Operations · 5 min read

systemd Service Failure Triage: Status, Journal, Exit Code, Dependencies and Restart Limits

A read-only Linux workflow for diagnosing a failed service before restarting, reinstalling or changing units.

Publisher: NetSignalKit Editorial | Corrections and feedback

Independent technical information. Validate vendor claims and test changes in your own environment. Some outbound commercial links may earn a commission; see our disclosure.

Do not start with restart

A restart can restore service while destroying the easiest evidence about why it stopped. For systemd-managed services, first capture unit state, recent journal entries, exit status, dependency state and restart counters.

The goal is observe → diagnose → change one cause → verify. Avoid reinstalling packages, editing unit files or rebooting the host until the evidence points there.

Step 1 — list failures and capture unit state

Start with systemctl --failed --no-pager, then systemctl status NAME.service --no-pager -n 50. Status combines current state, recent logs and process information, but it is still a summary.

Use systemctl show NAME.service -p LoadState -p ActiveState -p SubState -p ExecMainStatus -p Result -p NRestarts for machine-readable evidence. A service can be loaded but inactive, active but degraded at the application layer, or repeatedly restarting.

NetSignalKit RUNTIME-tested this pattern on authorized Debian 12 against systemd-journald.service: LoadState=loaded, ActiveState=active, SubState=running, ExecMainStatus=0 and Result=success. systemctl --failed returned zero failed units. That verifies command behavior, not a failure case.

Step 2 — read the journal with the correct permissions

Use journalctl -u NAME.service --since '2026-11-01 12:00' --no-pager or -n 100 for recent unit logs. Add -b to scope to the current boot when that distinction matters. For a crash loop, timestamps often show the application error immediately before systemd's restart decision.

During NetSignalKit's Debian QA, journalctl returned a real permission warning: the current user was not seeing other users' or system messages and needed membership such as adm/systemd-journal for full visibility. The command returned no unit entries in that context. That is an important interpretation rule: an empty journal can mean insufficient visibility, not 'there were no errors.'

Do not escalate privileges silently. Record the execution principal and available journal scope; obtain authorized access if deeper logs are needed.

Step 3 — separate application exit from systemd policy

ExecMainStatus and Result show how the main process ended from systemd's perspective. Then inspect the unit's ExecStart, Restart, RestartSec, StartLimitIntervalSec and StartLimitBurst values with systemctl cat/show.

A program that exits immediately because its config is invalid may become 'start request repeated too quickly' after systemd enforces restart limits. The rate-limit message is then a consequence, not the original root cause. Find the first application/config error in the journal.

Step 4 — inspect dependencies and ordering

systemctl list-dependencies NAME.service and unit properties such as Requires, Wants, After and Before can reveal dependencies, but remember that ordering and requirement semantics are different. A unit starting after the network target does not prove a specific remote database or DNS service is reachable.

Test external dependencies read-only: DNS resolution, local socket/listener, file existence/permissions and TCP reachability appropriate to the service. Do not edit dependency lines until you can show the current relationship is wrong.

Step 5 — validate configuration before changing the unit

Many daemons expose a parse/test mode: nginx -t, apachectl configtest, sshd -t and similar. Use the application's documented validation command when available. These are examples, not universal commands.

If a unit uses EnvironmentFile, drop-ins or credentials, inspect paths and metadata without printing secrets into logs/evidence. A missing file, wrong working directory or changed permission can look like an application crash while the binary itself is healthy.

Step 6 — make the smallest fix

Once the evidence identifies one root cause, change only that cause. Examples include correcting an invalid config, restoring a missing dependency, fixing a service-account file permission through approved configuration management, or deploying the documented package fix.

Use systemctl daemon-reload only when unit definitions/drop-ins actually changed. Restart only the target service when possible. A full reboot is a much larger variable and should not be the default troubleshooting step.

Common failed approaches

Do not run systemctl reset-failed before recording the failure/restart state if that evidence matters. Do not loop restart until it works; this can trigger rate limits and overwrite useful logs. Do not reinstall the package because 'systemd says failed' without identifying whether the failure is config, dependency, credential, resource or binary related.

Do not interpret an empty journal as proof of no log messages until the current principal's journal visibility is known.

Verification after the fix

  • systemctl is-active NAME.service returns active where active is the intended state.
  • systemctl show reports expected Result/ExecMainStatus and restart count is stable.
  • Journal has no repeating startup/crash loop during the observation window.
  • Expected listener/socket exists if the service should expose one.
  • Representative application health/transaction succeeds; service-manager green state alone is not enough.
  • Dependent monitoring/backup/consumer paths succeed.
  • Temporary debugging overrides are removed and the final unit/config state is documented.

Evidence classification

RUNTIME: systemctl --failed/status/show and journalctl were executed on authorized Debian 12. The journal permission limitation was directly observed. AUTHORITATIVE: command and unit-state semantics are sourced from systemd manuals. NOT TESTED: NetSignalKit did not deliberately crash a production service or modify systemd units for this article.

Worked negative case: systemd status 203/EXEC (synthetic exercise)

SYNTHETIC FAILED UNIT, NOT A SERVICE CRASHED FOR THIS ARTICLE: A status sample reads Process: 1752 ExecStart=/opt/example/bin/worker (code=exited, status=203/EXEC) and Active: failed (Result: exit-code). The service manager failed to execute the configured program; 203 maps to systemd EXIT_EXEC for an execve failure. This can result from a missing executable, inaccessible path, invalid interpreter or a related execution prerequisite. It does not prove that the application initialized and then failed from an internal logic error.

READ-ONLY DECISION PATH: Record systemctl show example.service -p ExecStart -p Result -p ExecMainStatus -p NRestarts, then review journalctl -u example.service -b --no-pager with the permissions actually available. Compare ExecStart to the versioned deployment manifest, executable existence, permissions and interpreter/shebang before approving any change. An absent journal under restricted principal is not evidence of no logged failure. No commands in this exercise start, stop or alter a real service.

NEGATIVE CONTROL: If a different synthetic trace has status=1/FAILURE after the executable launched, the 203/EXEC hypothesis no longer fits; inspect program-specific startup logs and configuration instead. A restart-limit message after repeated attempts may only be a consequence. Every change request must preserve rollback and target only the proven cause.

  • Expected output classification: exit code 203/EXEC maps to execution setup failure; inspect the executable path, filesystem permission and interpreter.
  • Counterexample: nonzero application exit status does not automatically mean 203/EXEC; distinguish the exact Result, exit code and earliest journal error.
  • Do not reset-failed or repeatedly restart before collecting the original state; avoid altering any unit in a production environment solely to reproduce this example.

Related guides

Primary sources & further reading

Sources are credited for verification, not reproduced. Linked pages may change after publication.