Code & computing / QUICK REFERENCE
Systemd Service and Journal Inspection
Read-only systemctl and journalctl commands for finding loaded services, checking unit states and narrowing logs without changing a running host.
Find services and distinguish states
- See loaded service units
systemctl list-units --type=service --no-pagerShows units currently in manager memory, normally active/pending/failed. Not a complete installation inventory. [1]
- Include inactive loaded services
systemctl list-units --type=service --all --no-pagerAdds inactive loaded units, but not every installed unit-file template. [1]
- Inventory installed service files
systemctl list-unit-files --type=service --no-pagerShows installed unit-file enablement states, not live ActiveState or whether the service is running. [1]
- List loaded failed services
systemctl list-units --type=service --state=failed --no-pagerRestricts the loaded-unit view to failed state. A cleared/unloaded historical failure may no longer appear. [1]
- Human-readable unit status
systemctl status example.service --no-pagerIncludes state and potentially recent journal lines; it can expose sensitive log text. Substitute a known authorized unit. [1]
- Machine-readable unit properties
systemctl show example.service -p LoadState,ActiveState,SubState,UnitFileState --no-pagerParse these named properties rather than scraping colored or wrapped status output. Properties vary across types/releases. [1]
- Check one service state
systemctl is-active example.serviceExits successfully when this unit is active. A service can be active but not healthy at the application level. [1]
- Beware multiple-unit is-active
systemctl is-active one.service two.serviceThe exit code is zero if ANY matched unit is active, not only if both are active; inspect each independently for an all-up check. [1]
Inspect unit files, dependencies and timers
- Enabled is not active
systemctl is-enabled example.serviceReports unit-file enablement; a disabled unit may still be manually active, and an enabled one may be stopped. [1]
- Show effective unit file and drop-ins
systemctl cat example.servicePrints base unit and known drop-ins. The output can include sensitive Environment lines or filesystem paths: handle privately. [1][3]
- Inspect dependencies
systemctl list-dependencies example.service --no-pagerDisplays a hierarchy of requirement/wants dependencies; it is not a chronological restart history. [1]
- Inspect reverse dependencies
systemctl list-dependencies --reverse example.service --no-pagerShows units that depend on the given unit within supported dependency types. It does not prove startup ordering. [1][3]
- Inspect timer schedule state
systemctl list-timers --all --no-pagerShows NEXT/LAST scheduling and the service activated by timer units; missing triggers may reflect loaded/manager state. [1]
- Inspect socket activation
systemctl list-sockets --all --no-pagerShows known socket units and their listening endpoints; do not assume a listener is publicly reachable. [1]
- Show unit file paths
systemctl show example.service -p FragmentPath -p DropInPaths --no-pagerThe manager reports its loaded main configuration file and drop-in paths; an empty path may mean an implicit/transient unit. [1][3]
- Detect manager configuration staleness
systemctl show example.service -p NeedDaemonReload --no-pagerReports whether the manager thinks this unit needs a reload. This read-only diagnostic does not reload any service. [1]
Narrow journal logs to a unit, boot or time
- Recent lines for this boot
journalctl -u example.service -b -n 50 --no-pagerShow up to the latest 50 accessible entries for the named unit in the current boot. Missing lines may be permissions/retention. [2]
- Recent lines across available boots
journalctl -u example.service -n 25 --no-pagerQuery up to 25 most recent matching journal entries from accessible files, without restricting to the current boot. [2]
- A prior recorded boot
journalctl -u example.service -b -1 -n 30 --no-pagerQuery previous boot only if that boot is retained and visible; absence does not prove the service never ran. [2]
- Time interval in UTC
journalctl -u example.service --since "2026-10-26 14:00:00 UTC" --until "2026-10-26 15:00:00 UTC" --no-pagerTime filter is inclusive within the named interval. Explicit UTC avoids operator-local timezone assumptions. [2][4]
- Recent relative time
journalctl -u example.service --since "-1 hour" -n 50 --no-pagerTime is evaluated relative to command execution; last 50 still limits output. Do not call these permanent time windows. [2][4]
- Warning and more severe
journalctl -u example.service --priority=warning -n 50 --no-pagerPriority limit includes warning and more severe; user-level readability depends on journal permissions. [2]
- Precise timestamp format
journalctl -u example.service --output=short-iso-precise -n 20 --no-pagerISO-like timestamps with microseconds can aid comparisons; timezone presentation follows documented output convention. [2]
- List retained boots
journalctl --list-boots --no-pagerSummarizes boot IDs and first/last journal timestamps for boots available to your permissions. [2]
Output, privacy and read-only boundaries
- Display message text alone
journalctl -u example.service -n 20 -o cat --no-pagerOmit metadata in human view, not a privacy sanitizer: messages may contain secrets. Preserve provenance elsewhere if needed. [2]
- Regex filter on message text
journalctl -u example.service --grep="error|fail" -n 20 --no-pagerSearch only matching MESSAGE fields; unstructured spelling and severity may differ from priority filters. [2]
- Machine-readable log lines
journalctl -u example.service -n 10 -o json --no-pagerEmits newline-delimited JSON objects, not one JSON array. Individual fields can contain identifying material. [2]
- Limit JSON output fields
journalctl -u example.service -n 10 -o json --output-fields=MESSAGE,PRIORITY --no-pagerLimit explicitly reported fields; check actual output and never assume logs are anonymized. [2]
- Check journal storage footprint
journalctl --disk-usageDisplays disk space occupied by accessible journals; not a count of application incidents. [2]
- Verify a known offline journal file
journalctl --verify --file=/path/to/copy.journalVerify an intentionally selected copied journal file in your own workspace. Do not rotate/vacuum or mutate live journals. [2]
- Inspect an authorized user unit
systemctl --user status example.service --no-pagerQueries the user service manager, not system services. Requires a running/accessible user manager. [1]
Reserved placement, separate from reference controls. No ad network is active.
No matching entry. Try a shorter word or clear the search to see the complete sheet.
Sources
cheatsheetatlas.com/sheets/systemd-service-inspection/ · Updated 2026-10-26 · systemd 259.5 on VPS, upstream systemd 262 manual inspected 26-Oct-2026