Infrastructure

Linux systemd: diagnose a start limit before restarting a production service

A production runbook for preserving systemd failure evidence, identifying the first failed start and recovering a service without disabling its restart guardrail.

27 Nov 2026 linuxsystemdobservabilityincidentrunbookrollbackproduction

A production worker stops processing after a configuration deployment. Its unit reports start-limit-hit. Repeatedly clearing the failure and restarting it can hide the original error, duplicate work or overload a dependency.

The example is a long-running worker with automatic restart enabled. First preserve the failure evidence, then identify why the initial attempt failed. The inspection commands below are read-only; the recovery steps are explicitly marked.

Freeze the evidence and scope

Pause deployment automation and health checks that issue restarts, after coordinating with the service owner. Check whether another replica can safely carry traffic. Record the host, UTC incident window, unit name, deployment version, impact, recent changes and any work in flight. Do not assume that a stopped worker left its last job untouched.

systemctl status example-worker.service --no-pager -l
systemctl show example-worker.service -p ActiveState -p SubState -p Result \
  -p ExecMainCode -p ExecMainStatus -p NRestarts -p FragmentPath -p DropInPaths
journalctl -u example-worker.service --since "2026-11-27 07:00:00 UTC" \
  --until "2026-11-27 08:00:00 UTC" -o short-iso-precise --no-pager
systemctl cat example-worker.service

Replace the example times and unit with the actual incident values. Export the relevant journal according to the team’s access and retention policy: logs may contain secrets or personal data. Look for the first failed attempt, not just the final rate-limit message. Check earlier boots with journalctl --list-boots and -b when applicable; missing or rotated logs are not proof that no earlier failure occurred.

Separate the guardrail from the cause

StartLimitIntervalSec= and StartLimitBurst= limit starts, including manual starts, within a window. Restart= determines when a service is retried; the limit can then stop further automatic attempts. The rate limit is the consequence, not an explanation for the original exit. Defaults and available properties depend on the installed systemd version.

systemctl --version
systemctl show example-worker.service -p Restart -p RestartUSec \
  -p StartLimitIntervalUSec -p StartLimitBurst -p Type -p TimeoutStartUSec
systemctl list-dependencies example-worker.service

Compare the effective unit and drop-ins with the approved deployment. Inspect the first error and its timestamp alongside dependency and host evidence:

  • Exit status or signal: identify the failing executable and application error; check configuration, permissions, credentials and recent release changes. An exit code alone is not a root cause.
  • Start timeout: check the configured service type, readiness notification and dependency latency. A longer timeout only helps when startup is genuinely progressing within a justified bound.
  • Resource pressure: correlate the unit and kernel journal with memory, disk and process limits. An OOM indication requires checking the affected process and cgroup, not simply increasing memory.
  • Dependency unavailable: validate name resolution, connectivity and authentication from the service’s actual execution context. Check the dependency’s own health and avoid retry storms.

A running process is not necessarily a healthy worker. Conversely, an unavailable dependency should not be “fixed” by weakening authentication or disabling the start limit.

Repair and recover one instance

Agree on a bounded repair: for example, restore the last known good configuration through its declarative owner, after checking compatibility and the effect on in-flight jobs. Preserve the candidate and the previous version. If the deployment changed persistent data or job semantics, a binary rollback alone may not reverse those effects; reconcile them before resuming.

After the cause is addressed and authorization is recorded, choose one instance for recovery. The following commands change state:

sudo systemctl reset-failed example-worker.service
sudo systemctl start example-worker.service

reset-failed clears the failed state and counters; it does not repair the cause or start the service. A start can execute real work. Do not reset every unit or restart the fleet. If the unit or drop-in was changed on disk, review the change and use the appropriate daemon-reload before starting; it reloads unit definitions, not application configuration.

Validate, then decide

Observe the canary over a period appropriate to the workload. Confirm the effective version and configuration, stable unit state, absence of recurring failures, dependency health and a representative job’s end-to-end result. Reconcile acknowledgements, duplicate side effects and backlog with the application owner before releasing more work. A green active state alone is insufficient.

If the original failure returns, stop rollout, preserve the new evidence and return to the last known safe configuration using the approved procedure. If a job’s outcome is uncertain, quarantine it for reconciliation rather than replaying blindly. Escalate if no safe rollback exists.

Decision: resume automation and expand one instance at a time only after the worker performs a representative job correctly and the restart loop remains absent. Otherwise keep the affected scope contained.

References