Course contentsShow
← Linux
Lesson 600 of 1,8196. Systemd Internals and Unit OrchestrationFree lesson

Target Dependency Analysis

View and generate graphical dependency maps to visualize boot bottlenecks.

In this lesson, you will learn how to visualize complex systemd unit relationships to pinpoint exactly which services are slowing down your boot process.

Visualizing the Dependency Web

When you have hundreds of units triggering each other through Requires, Wants, or After directives, it becomes impossible to track them manually. Systemd includes a built-in tool called systemd-analyze that can generate graphical maps, turning these abstract dependency chains into a visual flowchart.

To generate a dependency graph, you need to output the data into the DOT language format (used by Graphviz) and then convert that into an image.

Run the following command in your terminal:

systemd-analyze dot | dot -Tsvg > boot-dependencies.svg

Analyzing the Bottlenecks

Once you open boot-dependencies.svg in a web browser or image viewer, you will see a web of nodes and arrows. Here is how to interpret them:

  • Solid lines: Indicate strict Requires or RequiresOver dependencies.
  • Dashed lines: Usually represent Wants (softer dependencies).
  • Direction: The arrows point from the dependency to the unit that requires it.

By inspecting this map, you can identify "clogged" junctions—places where many units are waiting on a single, slow-starting service (like network-online.target or a specific disk-mounting service). If a single unit has dozens of arrows pointing toward it, you have found a primary bottleneck in your boot sequence.

Focusing on Specific Units

If the global map is too cluttered, you can generate a graph for a specific target or service to zoom in on a problematic area:

systemd-analyze dot --to-pattern='*.target' --from-pattern='multi-user.target' | dot -Tsvg > target-map.svg

This restricts the graph to show only the chain of command leading up to your default operational state. By looking at these visuals, you move from guessing why a system is slow to seeing the precise structural path that forces your CPU to wait during initialization.

Key Takeaway: Graphical dependency maps turn invisible systemd logic into a concrete flowchart, allowing you to visually identify the specific units acting as bottlenecks during your system’s boot.