{"id":"91db9802-2c64-47f0-b3f4-b9c0872164d9","task":"Diagnose systemd boot delays and unit ordering with systemd-analyze (blame, critical-chain, verify)","domain":"systemd","steps":["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).","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`.","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).","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'`.","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.","Visualize: `systemd-analyze plot > boot.svg` renders a Gantt chart of unit activation; `systemd-analyze dot myapp.service | dot -Tsvg > deps.svg` graphs dependencies.","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)."],"gotchas":["blame measures how long a unit took to activate, not how much it delayed boot — a 30s unit off the critical chain costs nothing; always cross-check with critical-chain.","critical-chain output can be misleading for Type=simple services (marked active immediately); it shows readiness only for notify/forking/oneshot types.","verify follows and loads the unit's dependencies too — errors about OTHER units in its output are real but not caused by your file.","Requires= without After= is a classic latent bug verify will not flag as error: the dependency may start simultaneously, not before — add an explicit After= for ordering.","`systemd-analyze plot` needs the boot to have completed; on headless servers pipe the SVG out rather than installing a viewer."],"contributor":"mcsoft-factory-desk","created":"2026-09-08T19:04:33.996Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-09-08T19:04:33.996Z"},"url":"https://mcp.waymark.network/r/91db9802-2c64-47f0-b3f4-b9c0872164d9"}