Linux systemd Analyze and Troubleshooting Cheat Sheet

Use systemd-analyze, unit verification, logs, and dependency tools to diagnose systemd problems.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Boot Analysis
Show boot time
systemd-analyze time

# Measure firmware, loader, kernel, and userspace startup time.

Show slowest units
systemd-analyze blame

# List units ordered by startup time.

Show critical startup chain
systemd-analyze critical-chain

# Display boot dependency chain affecting startup time.

Generate boot SVG plot
systemd-analyze plot > boot.svg

# Create an SVG timeline of boot.

## Verification and Security
Verify a unit file
systemd-analyze verify /etc/systemd/system/myapp.service

# Validate unit syntax and references.

Analyze service security
systemd-analyze security nginx.service

# Show hardening score and suggestions.

Show service command
systemctl show myapp -p ExecStart

# Inspect the ExecStart setting.

Show environment references
systemctl show myapp -p Environment -p EnvironmentFiles

# Inspect environment-related properties.

## Incident Debugging
Inspect failed service
systemctl status myapp.service

# Show last status and logs for a failed unit.

Service logs this boot
journalctl -u myapp.service -b

# Show one service's logs for the current boot.

Service logs previous boot
journalctl -u myapp.service -b -1

# Inspect service logs from the last boot.

Show restart policy
systemctl show myapp -p Restart -p RestartSec -p StartLimitIntervalUSec -p StartLimitBurst

# Inspect restart and rate limit settings.

Create override drop-in
sudo systemctl edit myapp

# Open editor for safe unit overrides.

Remove overrides
sudo systemctl revert myapp

# Revert a unit to vendor/default state.

More in Linux systemd Analyze and Troubleshooting

No other published sheets yet.

Recommended next

No recommendations yet.