Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for Linux Admins Difficulty: Advanced ClaudeChatGPT

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

More Linux Admins prompts & error guides

Browse every Linux Admins prompt and troubleshooting guide in one place.

Free download · 368-page PDF

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.