Back to lessons

Linux Survival Basics

Risk: caution

Reset Failed State After Capturing Evidence

systemctl --failed still shows an old service failure after the issue was fixed, and you need to clear the recorded failed state deliberately.

Command

systemctl reset-failed app-worker

Before you run this

Risk: caution. Do not run it before collecting status and journal evidence, and do not confuse clearing state with fixing the service.

Expected output

Either no output or a short confirmation that the failed state was reset.

System impact

systemd clears the recorded failed state for the service, so future --failed output reflects new failures.

When to use it

Use after documenting or fixing a failure when the failed state itself is stale noise.

When not to use it

Do not run it before collecting status and journal evidence, and do not confuse clearing state with fixing the service.

Recovery / rollback

There is no meaningful undo for clearing the marker; use saved logs or incident notes for prior evidence.

Watch this command run

Example output from a temporary Linux lab

This example uses disposable sample files and sanitized output so you can inspect the shape of the result before touching a real system.

demo@lab:~$

$ systemctl show app-worker --property=Result,ExecMainCode,ExecMainStatus,NRestarts --no-pager

Result=exit-code
ExecMainCode=1
ExecMainStatus=217
NRestarts=5

$ systemctl reset-failed app-worker

Reset failed state for app-worker.service.
View reproducible demo details

This page shows the sanitized shell transcript and the setup steps needed to reproduce the example.

Lab setup steps

  1. systemctl show app-worker --property=Result,ExecMainCode,ExecMainStatus,NRestarts --no-pager
  2. systemctl reset-failed app-worker

next steps

Related commands

Linux Survival Basics Risk: safe

Read the Failure Cause in systemctl Status

The status page often tells you the failed startup step before you open every log.

systemctl status app-worker --no-pager --lines=50
Linux Survival Basics Risk: safe

Print the Exact systemd Exit Fields

Turn a noisy service failure into four fields you can paste into an incident note.

systemctl show app-worker --property=Result,ExecMainCode,ExecMainStatus,NRestarts --no-pager
Linux Survival Basics Risk: safe

Check If a Service Is Active

Get a clean yes-or-no service state without the full status page.

systemctl is-active nginx
Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • lpic1:101-system-architecture
  • lpic1:103-gnu-unix-commands
  • lpic1:108-essential-services
  • lfcs:essential-commands
  • lfcs:operations-deployment
  • lfcs:services-logs
  • linuxplus:provisional
  • linuxplus:services-users
  • linuxplus:troubleshooting
  • risk:production-state-change

Useful for

  • LPIC-1 style command-line practice
  • LFCS style performance tasks
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.