Linux Survival Basics
Changes system stateReset 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
System impact: Changes system or application state. Needs inspection, scoping, and rollback notes before production use.
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.
Expected output
Either no output or a short confirmation that the failed state was reset.
System impact
Changes system state. 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
Command transcript
This sanitized transcript shows the commands and output shape without exposing host details.
$ 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 commands shown
These are the commands shown in the sanitized transcript.
Commands shown
systemctl show app-worker --property=Result,ExecMainCode,ExecMainStatus,NRestarts --no-pagersystemctl reset-failed app-worker
next steps
Related commands
Compare Failure Output With the Effective Unit
Put the failed step next to the unit config that created it.
systemctl status app-worker --no-pager --lines=50 && systemctl cat app-worker
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
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
Inspect the Unit File and Drop-ins Together
The bug may be in an override file, not the main unit.
systemctl cat app-worker
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.
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.