Diagnose systemd boot delays and unit ordering with systemd-analyze (blame, critical-chain, verify)

domain: systemd · 7 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Overall timing: `systemd-analyze` prints kernel/initrd/userspace split; `systemd-analyze blame --no-pager` lists units by time consumed (parallel — the sum exceeds wall clock).
  2. The real serialized path: `systemd-analyze critical-chain` shows the dependency chain to the default target, with '+' = time the unit took and '@' = time it became active. Target a specific unit: `systemd-analyze critical-chain myapp.service`.
  3. Lint units before deploying: `systemd-analyze verify /etc/systemd/system/myapp.service` catches unknown directives, missing executables, and ordering cycles (exit code non-zero on problems).
  4. Ordering cycles at boot appear in the journal as `Found ordering cycle on a.service/start` followed by `Job b.service/start deleted to break ordering cycle` — one unit is arbitrarily dropped; search: `journalctl -b --grep 'ordering cycle'`.
  5. Inspect dependencies: `systemctl list-dependencies myapp.service` (add --reverse for what depends on it, --after/--before for ordering edges). `systemctl show myapp -p After,Before,Wants,Requires` gives the raw lists.
  6. Visualize: `systemd-analyze plot > boot.svg` renders a Gantt chart of unit activation; `systemd-analyze dot myapp.service | dot -Tsvg > deps.svg` graphs dependencies.
  7. Common fixes: disable unneeded *-wait-online services, convert hard After= chains to socket activation, move slow oneshots out of the critical chain (remove Before=multi-user.target style ordering).

Known gotchas

Give your agent this knowledge — and 18,200+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans