Skip to content

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:

systemctl list-dependencies

Show dependencies for a specific unit:

systemctl list-dependencies sshd.service

Show reverse dependencies (what depends on this unit):

systemctl list-dependencies sshd.service --reverse

Show all dependencies recursively (can be large):

systemctl list-dependencies multi-user.target --all

Check what a unit wants vs requires:

systemctl show sshd.service -p Wants -p Requires -p After -p Before

List all units ordered by dependency:

systemctl list-dependencies --type=service

Verify a unit's position in boot order:

systemctl list-dependencies sysinit.target --all | grep -i network

What to Look For

  • Green dots indicate active units; red dots indicate failed or inactive
  • Wants means soft dependency (failure is tolerated), Requires means hard dependency
  • After/Before control ordering but not activation
  • Reverse dependencies show you what will break if you stop a unit

Common Mistakes

  • Confusing Wants (soft) with Requires (hard) dependencies
  • Assuming After implies Requires -- ordering and activation are separate
  • Not using --reverse when trying to find out why a unit starts
  • Ignoring that list-dependencies shows the target tree, not boot order alone

Cleanup

No cleanup needed. These are read-only inspection commands.