Linux Survival Basics
Risk: safePrint the Exact systemd Exit Fields
Full status output is useful for humans, but incident notes and scripts need compact fields like Result, ExecMainStatus, and restart count.
Command
systemctl show app-worker --property=Result,ExecMainCode,ExecMainStatus,NRestarts --no-pager
Before you run this
Risk: safe. Do not treat numeric status values as self-explanatory; pair them with status or journal lines.
Expected output
Result, ExecMainCode, ExecMainStatus, and NRestarts property lines.
System impact
Nothing changes. systemctl show prints selected unit properties.
Recovery / rollback: no state is changed.
When to use it
Use when documenting a failure, comparing before and after recovery, or writing a runbook check.
When not to use it
Do not treat numeric status values as self-explanatory; pair them with status or journal lines.
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 status app-worker --no-pager --lines=50
● app-worker.service - Background job worker
Loaded: loaded (/etc/systemd/system/app-worker.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/app-worker.service.d
└─override.conf
Active: failed (Result: exit-code) since Thu 2026-06-25 14:22:17 CDT; 4min ago
Duration: 1.243s
Process: 2144 ExecStart=/srv/app/bin/worker --queue default (code=exited, status=217/USER)
Main PID: 2144 (code=exited, status=217/USER)
CPU: 38ms
Jun 25 14:22:17 vps systemd[1]: Started app-worker.service - Background job worker.
Jun 25 14:22:17 vps systemd[2144]: app-worker.service: Failed to determine user credentials: No such process
Jun 25 14:22:17 vps systemd[2144]: app-worker.service: Failed at step USER spawning /srv/app/bin/worker: No such process
Jun 25 14:22:17 vps systemd[1]: app-worker.service: Main process exited, code=exited, status=217/USER
Jun 25 14:22:17 vps systemd[1]: app-worker.service: Failed with result 'exit-code'.
$ systemctl show app-worker --property=Result,ExecMainCode,ExecMainStatus,NRestarts --no-pager
Result=exit-code
ExecMainCode=1
ExecMainStatus=217
NRestarts=5
View reproducible demo details
This page shows the sanitized shell transcript and the setup steps needed to reproduce the example.
Lab setup steps
systemctl status app-worker --no-pager --lines=50systemctl show app-worker --property=Result,ExecMainCode,ExecMainStatus,NRestarts --no-pager
next steps
Related commands
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
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
Inspect One Service Without Pager Traps
Make systemctl status safe for scripts, screenshots, and quick incident notes.
systemctl status nginx --no-pager --lines=30
Print Runtime Paths and User From systemd
Confirm the user, working directory, env file, and ExecStart systemd is actually using.
systemctl show app-worker --property=FragmentPath,DropInPaths,EnvironmentFiles,ExecStart,User,WorkingDirectory --no-pager
Show Failed systemd Units
One command tells you which services systemd already knows are broken.
systemctl --failed --no-pager
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.