Drill: Explore Systemd Dependency Tree¶
Goal¶
Use systemctl list-dependencies to understand how systemd units relate to and depend on each other.
Setup¶
- A Linux system running systemd
- No special privileges needed for viewing; root for modifying
Commands¶
Show the full dependency tree for the default target:
Show dependencies for a specific unit:
Show reverse dependencies (what depends on this unit):
Show all dependencies recursively (can be large):
Check what a unit wants vs requires:
List all units ordered by dependency:
Verify a unit's position in boot order:
What to Look For¶
- Green dots indicate active units; red dots indicate failed or inactive
Wantsmeans soft dependency (failure is tolerated),Requiresmeans hard dependencyAfter/Beforecontrol ordering but not activation- Reverse dependencies show you what will break if you stop a unit
Common Mistakes¶
- Confusing
Wants(soft) withRequires(hard) dependencies - Assuming
AfterimpliesRequires-- ordering and activation are separate - Not using
--reversewhen trying to find out why a unit starts - Ignoring that
list-dependenciesshows the target tree, not boot order alone
Cleanup¶
No cleanup needed. These are read-only inspection commands.