systemd Unit Dependency & Boot Ordering Graph Prompt
Untangle why a service starts too early, deadlocks at boot, or races a mount/network by reasoning over the After/Wants/Requires dependency graph.
- Target user
- Linux sysadmins and SREs
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior Linux systems engineer who specializes in systemd ordering and boot-time race conditions. I will provide: - The failing unit file(s) and any drop-ins under /etc/systemd/system/*.d/ - Output of `systemctl list-dependencies --all <unit>` and `systemd-analyze critical-chain <unit>` - Relevant `journalctl -b -u <unit>` lines and `systemd-analyze blame` output - A description of the symptom (starts before network/mount, deadlock, timeout) Your job: 1. **Classify the relationship** — explain the difference between After/Before (ordering) vs Wants/Requires/BindsTo/PartOf (requirement), and which my symptom implies is wrong. 2. **Map the graph** — reconstruct the actual ordering chain leading to the failure, naming the target (multi-user.target, network-online.target) involved. 3. **Spot the anti-pattern** — e.g. depending on network.target instead of network-online.target, or missing RequiresMountsFor=. 4. **Identify cycles** — call out any ordering cycle systemd would break and which edge it drops. 5. **Propose minimal edits** — exact After=/Wants= lines, or a drop-in, never editing vendor units directly. 6. **Add the right wait** — recommend systemd-networkd-wait-online, a device/mount unit, or a ConditionPathExists= instead of sleeps. 7. **Verify plan** — give the `systemctl daemon-reload`, `systemd-analyze verify`, and reboot/`systemctl isolate` test sequence. Output as: (a) root-cause narrative, (b) corrected unit/drop-in, (c) verification commands, (d) rollback note. Never delete vendor unit files; use drop-ins so changes survive package upgrades and can be reverted with a single rm.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
systemd Unit Failure Debugging Prompt
Diagnose systemd unit failures — dependency cycles, mount/target failures, exit codes, journalctl filtering, drop-in overrides, and silent service flapping.
-
CPU Frequency Governor & Power/Performance Tuning Prompt
Audit and tune Linux CPU frequency scaling (cpufreq governors, scaling driver, turbo/C-states, energy-performance bias) to balance latency, throughput, and power for a given workload.
-
Dirty Page Writeback & VM Tuning Review Prompt
Review Linux dirty-page writeback tunables (vm.dirty_ratio, dirty_background_ratio, dirty_expire/writeback centisecs, vfs_cache_pressure) against a workload and storage backend to smooth I/O stalls and fsync latency.
-
Linux Block I/O Scheduler Selection & Tuning Review Prompt
Review the per-device block I/O scheduler (mq-deadline, bfq, kyber, none) and queue tunables against a workload and storage type, and recommend a persistent, verifiable configuration.
More Linux Admins prompts & error guides
Browse every Linux Admins prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.