Skip to main contentClaim $5 in free credit — one-time, per account. Claim $5 free
Krova CloudKrova Cloud
Cloud Infrastructure

Recovering a systemd Service After a Start Limit Hit

Recover a systemd service by preserving the first failure, fixing its cause and deliberately clearing its start limit. Verify the application, not just a reset counter.

DM
Dhruv Malaviya6 min read
Share
Cloud Infrastructure cover: systemd Start Limit Hit, Recover With Evidence. Frosted-glass server and log cards lead to a turquoise retry arrow and gate.

Suppose you deploy a photo-processing API to a Linux server. It exits during startup, tries again, and eventually leaves you with “Start request repeated too quickly.” The most visible message is now about systemd’s limit, while the error that began the outage has scrolled out of view.

Recover in this order: preserve the earlier failure and current unit state, repair the cause those records identify, then clear the limit for that unit if necessary and verify the API itself. systemctl reset-failed makes another start possible; it does not fix the application.

The photo API here is hypothetical. This walkthrough applies to a systemd service you operate in a Linux guest, including a self-managed Krova Cube. It is proposed guidance, not a customer incident or a test performed for this article.

Read the refusal as one event in a longer sequence

The upstream unit manual defines StartLimitIntervalSec and StartLimitBurst as the interval and allowed burst of starts. The limit also applies to manual starts, not only automatic restarts. Read your unit’s actual settings rather than assuming every distribution uses the same numbers.

A service’s Restart policy operates inside that boundary. Even a policy that asks for restarts remains subject to the start limit, as the service manual explains. Repeatedly issuing start commands is therefore a poor substitute for finding the earlier launch failure.

For our photo API, separate three questions: Why did the application stop? Why is the manager refusing another launch? What evidence will show that image processing works again? Those questions have different answers, and clearing the second condition doesn’t answer the other two.

Preserve a useful view while the failure is still visible

Replace the example unit name with the exact service you manage. These first commands only read state. Use an account allowed to inspect that unit and its journal:

unit=photo-api.service

systemctl --version
TZ=Asia/Kolkata systemctl status "$unit" --no-pager --full
systemctl show "$unit" \
  -p ActiveState -p SubState -p Result \
  -p ExecMainCode -p ExecMainStatus -p NRestarts \
  -p Restart -p RestartUSec \
  -p StartLimitIntervalUSec -p StartLimitBurst

TZ=Asia/Kolkata journalctl -u "$unit" --since "-15min" \
  -o short-iso --no-pager

status is a brief human-readable view; show exposes selected properties. A failed or inactive unit can make status return a nonzero exit code, so run the later inspection commands even when that status check reports failure. The systemctl reference documents these commands.

The interval property uses the manager’s USec name, while the configuration directive uses Sec. The systemd D-Bus reference lists these properties, including NRestarts. That restart counter is not a complete ledger of every manual start. If a property is unavailable on the installed version, retain that limitation rather than treating an empty value as zero.

The journalctl manual documents unit and time filtering. Fifteen minutes is an illustrative window: widen it to include the deployment and the earliest relevant attempt. Read forward from that attempt, including application output before the limiter message.

For a user service, use the owning user’s manager consistently: systemctl --user and the corresponding journalctl --user -u query. Don’t inspect a system service and then reset a same-named user unit. Missing journal output can reflect scope, permissions, retention or another logging destination; it does not establish that nothing failed. Keep captured logs restricted and redact credentials or personal data before sharing them.

Repair the stage that failed

A current Result=start-limit-hit identifies the refusal. The earlier records identify what to investigate next. Use this as a reading aid, not a claim that one message proves a cause:

Earlier evidenceNext investigation
Application reports a missing or invalid configuration fileMatch the deployed file, expected path and service identity to the application’s documented requirements.
Manager reports that an executable could not be launchedInspect the exact command, installed artifact and access permissions; don’t infer a memory shortage from a launch error.
A preparation command fails before the main process startsInspect that preparation stage; the main process’s exit fields may not explain it.
Application starts, then reports a dependency failureCheck the named dependency and the application’s recovery behavior. A new retry allowance alone doesn’t make the dependency available.

In the hypothetical deployment, a configuration error would justify correcting that configuration through the normal release process. It would not justify disabling rate limiting. Retain the previous artifact and configuration so you can roll back a mistaken repair.

If the repair changes a unit definition, distinguish that edit from the manager loading it and from a new process using it. Krova’s systemd drop-in guide covers that separate sequence. A daemon reload is not an application restart.

Clear only the intended unit, then check what happened

Save the diagnostic record first. reset-failed clears failure state and counters, so a clean-looking counter afterward is not evidence that the earlier failures never occurred. After repairing the cause, and when another launch is appropriate for the workload, an operator can run:

unit=photo-api.service
sudo systemctl reset-failed "$unit" && sudo systemctl start "$unit"

These commands change service state. Use them only for the verified system service in an appropriate recovery window, accounting for work or external effects that a new launch could trigger. The explicit unit name avoids resetting unrelated failed units. If either command fails, preserve its output and investigate rather than repeating the pair.

The reset-failed documentation describes clearing both start-rate and service-restart counters. This operation alone does not launch the API. The separate start requests that launch.

Waiting is another distinct case. The unit documentation allows a later start after the interval passes, but reaching the limit stops the automatic restart sequence. Don’t assume expiration by itself schedules a fresh retry. If recovery depends on a timer, inspect that activation rule separately; a persistent timer is not a backfill or application retry policy.

Finish at the API boundary

Read the unit state and journal again, then use the application’s documented readiness check and one disposable representative request. For our photo API, that means verifying the expected transformed image or documented result, not merely seeing a PID. A process can exist while its dependencies or application initialization remain incomplete.

Keep a small recovery record: the unit and manager scope, first relevant error, artifact or configuration repaired, deliberate reset/start action, and the application check with its outcome. If the service fails again, capture the new attempt’s evidence. If it remains active but the request fails, continue with application diagnostics rather than declaring success from the cleared limit.

That gives you three explicit recovery conditions: the original failure has an explained repair, the manager permits a launch, and the application completes its intended operation. A green status line is useful evidence for one part of that story.

Run Linux services on a self-managed Cube

Explore Cube for a Linux workload whose service configuration, recovery procedure and application checks you control.

Creation context: This article and its conceptual cover were created with AI assistance using the linked primary documentation. The photo API and procedure are illustrative and were not executed. No personal testing, customer outcome or human review by the bylined author is claimed.

For AI agents:llms.txtsitemap

Related posts