Linux Survival Basics
Risk: cautionReset 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.
$ 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
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.