Back to commands

Hosting Operations

Read-only

Print Runtime Paths and User From systemd

A service failure points at credentials or paths, and you need systemd's resolved unit properties without reading multiple files manually.

Command

systemctl show app-worker --property=FragmentPath,DropInPaths,EnvironmentFiles,ExecStart,User,WorkingDirectory --no-pager

Before you run this

System impact: Read-only. Low when scoped to the shown target.

When not to use it: Do not assume these values prove the files exist or permissions are correct; follow up with ls, stat, getent, or namei as needed.

Expected output

Selected unit properties showing fragment paths, drop-ins, environment files, ExecStart, User, and WorkingDirectory.

System impact

Read-only. Nothing changes. systemctl prints selected runtime configuration properties.

Recovery / rollback: no state is changed.

When to use it

Use when a service fails at USER, CHDIR, EXEC, environment-file loading, or after a deploy that changed paths.

When not to use it

Do not assume these values prove the files exist or permissions are correct; follow up with ls, stat, getent, or namei as needed.

Watch this command run

Command transcript

This sanitized transcript shows the commands and output shape without exposing host details.

demo@lab:~$

$ 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=FragmentPath,DropInPaths,EnvironmentFiles,ExecStart,User,WorkingDirectory --no-pager

FragmentPath=/etc/systemd/system/app-worker.service
DropInPaths=/etc/systemd/system/app-worker.service.d/override.conf
EnvironmentFiles=/etc/app/worker.env (ignore_errors=no)
ExecStart={ path=/srv/app/bin/worker ; argv[]=/srv/app/bin/worker --queue default ; ignore_errors=no ; start_time=[Thu 2026-06-25 14:22:17 CDT] ; stop_time=[Thu 2026-06-25 14:22:17 CDT] ; pid=2144 ; code=exited ; status=217 }
User=missing-appuser
WorkingDirectory=/srv/app/current
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. systemctl status app-worker --no-pager --lines=50
  2. systemctl show app-worker --property=FragmentPath,DropInPaths,EnvironmentFiles,ExecStart,User,WorkingDirectory --no-pager

next steps

Related commands

Hosting Operations Read-only

Check Failed Dependencies for a Service

Sometimes the service is only the messenger for a failed dependency.

systemctl list-dependencies app-worker --failed --no-pager
Linux Survival Basics Read-only

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
Hosting Operations Can be slow

Find the First Failure Line for One Unit

The first failure line is often more useful than the last restart message.

journalctl -u app-worker -b --no-pager -o short-iso | grep -m1 -E 'ERROR|Failed|status='
Hosting Operations Can be slow

Build a Restart Loop Timeline

Restart loops make more sense when you line up starts, failures, and counters.

journalctl -u app-worker -b --no-pager -o short-iso | grep -E 'Started|Failed|Scheduled restart|Main process exited'
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:108-essential-services
  • lfcs:operations-deployment
  • lfcs:services-logs
  • linuxplus:provisional
  • linuxplus:services-users
  • linuxplus:troubleshooting
  • risk:read-only

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.