The Engine of Your Linux System
This interactive guide explores `systemd`, the foundational system and service manager for modern Linux. More than just an init system, `systemd` is a comprehensive suite of tools that manages nearly all aspects of the operating system after the kernel boots. At its core, `systemd` uses "units" as standardized building blocks to manage everything from services and hardware to filesystems and scheduled tasks. Understanding these units and their "dependencies"—the rules that connect them—is key to mastering system administration.
By defining clear relationships, `systemd` enables robust, on-demand activation of resources and aggressive parallelization of startup tasks, leading to a more efficient and reliable system. This application allows you to explore each unit type in detail and visualize how dependencies create order and reliability.
Modular Units
`systemd` treats every system resource as a "unit," providing a consistent way to manage services, sockets, mount points, and more.
Defined Dependencies
Units declare their relationships, ensuring that services start in the correct order and only when their prerequisites are met.
Parallel Execution
By understanding dependencies, `systemd` can start independent units simultaneously, leading to faster boot times.
Unit Explorer
`systemd` manages many different types of resources, each defined by a specific unit type. This standardized approach allows for consistent management across the entire system. Select a unit from the list below to learn about its purpose, see common configuration directives, and understand its typical use case. This section helps you break down the system into its fundamental components.
Select a unit type above to see its details.
Dependency Visualizer
Dependencies are the rules that govern how units interact, forming the core of `systemd`'s orchestration logic. This tool helps you visualize these critical relationships. Select two units and a dependency type to see a plain-language explanation and a simple diagram illustrating how `systemd` will handle the interaction. This is the best way to understand the practical difference between a critical `Requires=` and a more flexible `Wants=`.
Dependency Relationships
Not all dependencies are created equal. `systemd` distinguishes between critical requirements and optional "wants", as well as simple ordering rules. This chart provides a quick visual reference for the most common dependency types, illustrating their primary function: either linking units together (Requirement) or simply controlling their start sequence (Ordering). Use the tooltips to see a description of each dependency's role.
Unit Files & Overrides (Where + How)
systemd loads unit files from multiple locations with a clear precedence. The safest way to customize a service is usually via drop-in snippet files (overrides), not by editing vendor files directly.
Unit file locations (and precedence)
/etc/systemd/system/— Admin overrides (highest priority; you control it)/run/systemd/system/— Runtime/transient units (temporary; created at runtime)/usr/lib/systemd/system/— Vendor units (package-provided)- Note: On some distros vendor units can be in
/lib/systemd/system/.
Rule of thumb: if the same unit name exists in multiple places, systemd uses the highest-precedence one.
Drop-in “snippet” files (.d/*.conf)
A drop-in (snippet) is a small .conf file placed in:
/etc/systemd/system/<unit>.d/*.conf(persistent override)/run/systemd/system/<unit>.d/*.conf(runtime override)/usr/lib/systemd/system/<unit>.d/*.conf(vendor drop-ins)
systemd merges them (lexicographic order). This is why a common override file name is:
override.conf.
Overriding ExecStart (the correct rule)
For directives like ExecStart=, you can’t “append” safely. You usually must reset it first with an empty assignment, then set your new one.
Runtime overrides vs persistent overrides
- Persistent: saved under
/etc/systemd/system/...(survives reboot) - Runtime: saved under
/run/systemd/system/...(lost after reboot)
Masking (hard block)
Masking prevents a unit from starting at all (manual or automatic). Internally it is commonly implemented by a symlink to /dev/null in /etc/systemd/system.
See what you changed (diff tools)
systemd-delta is perfect for explaining “why does this service behave differently than default?”
Systemd Tools & Key Config Files
systemd is not just systemctl. It ships many tools (ctl commands) that talk to system services (daemons).
This section maps “tool → daemon → config files → useful commands”.
resolvectl (DNS)
Controls / queries systemd-resolved (DNS resolver).
/etc/systemd/resolved.conf(+resolved.conf.d/*.conf)/run/systemd/resolve/resolv.conf(generated)/etc/resolv.confis often a symlink (depends on distro setup)
timedatectl (time/NTP)
Controls time settings; NTP is typically via systemd-timesyncd.
/etc/systemd/timesyncd.conf(+timesyncd.conf.d/*.conf)
journalctl (logs)
Queries logs from systemd-journald.
/etc/systemd/journald.conf(+journald.conf.d/*.conf)
loginctl (sessions)
Talks to systemd-logind (users/sessions/seats).
/etc/systemd/logind.conf(+logind.conf.d/*.conf)
hostnamectl / localectl
System identity & locale management (via systemd services).
systemd-networkd tools (if used)
If your distro uses systemd-networkd, you manage links/networks with networkctl.
/etc/systemd/network/*.network,*.netdev,*.link
coredumpctl (crashes)
Inspect crashes collected by systemd-coredump.
/etc/systemd/coredump.conf(+coredump.conf.d/*.conf)
systemd-tmpfiles (temp rules)
Create/clean temp files/dirs using tmpfiles rules.
/etc/tmpfiles.d/*.conf(admin)/usr/lib/tmpfiles.d/*.conf(vendor)/run/tmpfiles.d/*.conf(runtime)
system-wide defaults
Global systemd manager settings (rarely changed but important).
/etc/systemd/system.conf(system manager)/etc/systemd/user.conf(user manager)
systemd-journald (Central Logging)
systemd-journald is the logging service that collects logs from the kernel, boot process, and services
(including stdout/stderr from .service units). It stores logs in a structured “journal” with rich metadata
(unit name, PID, user, boot ID, timestamps), making filtering and troubleshooting much easier than plain text logs.
How it works (in practice)
- Collects service output (stdout/stderr), kernel messages, and events during boot.
- Stores entries in a binary journal format with indexing (fast queries).
- Adds metadata like
_SYSTEMD_UNIT,_PID,_UID,_BOOT_ID, etc. - Retention is controlled by size/time limits and vacuum settings.
Logs are stored either in memory (volatile) or on disk (persistent):
/run/log/journal/→ volatile (lost after reboot)/var/log/journal/→ persistent (survives reboot)
Service + config locations
- Service:
systemd-journald.service - Main config:
/etc/systemd/journald.conf - Drop-in snippets:
/etc/systemd/journald.conf.d/*.conf - Vendor defaults: usually under
/usr/lib/systemd/(don’t edit)
Most useful journalctl commands (daily work)
Tip: If you need non-root read access, add your user to systemd-journal group:
Maintenance commands (size/cleanup/rotation)
These are common “daily admin” tasks when logs grow too much or disks fill up.
Common configuration (practical recipes)
Best practice: use a drop-in file instead of editing the main config directly.
Create /etc/systemd/journald.conf.d/override.conf.
A) Enable persistent logs + reasonable limits
B) Apply changes (what to run)
C) Forward to syslog (if you still use rsyslog/syslog-ng)
Useful when you want journald + classic text logs at the same time.
D) Make logs more verbose for troubleshooting (temporary)
Use temporarily—debug logging can be noisy.
systemd-tmpfiles (Create & Clean Files/Dirs Automatically)
systemd-tmpfiles is a rules-based tool used to create, fix (permissions/ownership),
and clean/remove files and directories in a consistent way—especially for paths that must exist after boot
(like /run) and for cleaning old cache/temp content.
How it works (mental model)
- Rules live in
tmpfiles.d/*.conffiles. - Create pass (
--create): makes directories/files/symlinks and fixes perms/owners. - Clean pass (
--clean): deletes files based on theAGEcolumn (retention). - Remove pass (
--remove): removes paths/contents that rules mark as removable (stronger than clean). - Boot-only rules can be marked with
!and applied when tmpfiles is invoked in boot mode.
Config locations (precedence)
/etc/tmpfiles.d/*.conf— admin rules (highest priority)/run/tmpfiles.d/*.conf— runtime rules (temporary)/usr/lib/tmpfiles.d/*.conf— vendor/package rules
Best practice: put your custom rules in /etc/tmpfiles.d/.
When does it run automatically?
systemd typically runs tmpfiles automatically using system units:
systemd-tmpfiles-setup.service: runs during boot to apply “create” rules (prepare paths like/run).systemd-tmpfiles-clean.timer→systemd-tmpfiles-clean.service: runs periodically to do cleanup (--clean).
Want to change cleanup frequency? Override the timer:
Most useful commands (daily ops)
The most common real-life use: a service fails because /run/myapp doesn’t exist → run tmpfiles create and restart the service.
Rule format
Each line is:
Notes:
• AGE controls cleanup eligibility (only matters for --clean).
• If you don’t need a field, use -.
• Add ! after the type (example: r!) to mark “boot-only”.
Most used types (with practical meaning)
d: create a directory (if missing). IfAGEis set, its contents may be cleaned when old.D: create a directory (if missing) and treat it as removable for “remove mode” workflows (strong cleanup scenarios).e: “empty/cleanup managed directory” — do not rely on it to create new directories in all cases; use it mainly to apply cleanup policy to an existing directory and keep it clean by AGE.v: create a btrfs subvolume (if possible); otherwise behaves like a normal directory rule.q: btrfs subvolume likev, but attaches it to the same qgroup/quota context as the parent (when qgroups are enabled).Q: btrfs subvolume likev, but creates a new “subtree” qgroup/quota context for that subvolume (when qgroups are enabled).f/f+: create file if missing;f+truncates/replaces content (ARGUMENTS can provide content).w/w+: write/append to an existing file;w+may create if missing depending on usage.L/L+: create a symlink;L+replaces an existing path if necessary.z/Z: fix ownership/mode/labels;Zapplies recursively.a/A: set ACLs;Arecursively.t/T: set xattrs;Trecursively.r/R: remove a path (or glob);Ris recursive (dangerous if misused).x/X: exclude from cleanup (x is recursive ignore, X is non-recursive ignore).
If you’re not on btrfs or don’t use qgroups, you can ignore v/q/Q.
Most admins live in d, z/Z, L, and cleanup via e + AGE.
Practical examples (copy/paste patterns)
1) Create /run directory for a service (most common)
2) Ensure a persistent dir exists with strict perms
3) Enforce perms recursively (after deployment)
4) Boot-only removal of stale lock files
5) Symlink for compatibility
6) Cleanup policy example (keep cache tidy)
Use a cleanup-managed directory policy: keep cache files only for a limited time (AGE).
systemd-networkd (Network Management)
systemd-networkd is a lightweight network manager for servers and minimal systems.
It configures interfaces based on declarative files and reacts to link/device events (interfaces appearing/disappearing).
It’s commonly paired with systemd-resolved for DNS and systemd-networkd-wait-online for “network is ready” semantics.
How it decides what to apply
- Match first: it evaluates
[Match]in.networkfiles. - First match wins: the first matching file (by filename sort) is applied; later matches are ignored.
- Tip: prefix filenames with numbers like
10-,20-to control ordering (commonly keep < 70).
Config file types
.network: assign addresses, DHCP client/server, routes, DNS, NAT..netdev: create virtual devices (bridge, bond, vlan, veth, wireguard, …)..link: low-level link settings (naming rules, MTU, MAC policy, etc.).
Where files live (precedence)
/etc/systemd/network/(admin, highest priority)/run/systemd/network/(runtime/temporary)/usr/lib/systemd/network/(vendor/package defaults)
Same filename in /etc overrides vendor files. You can also use drop-ins like
foo.network.d/*.conf for overrides.
Core commands you’ll actually use
If another network manager (like NetworkManager) is active, don’t run both on the same interface.
Example 1: Simple DHCP client on a WAN interface
Get an IPv4 address from upstream DHCP on enp1s0.
Example 2: Static IP + gateway + DNS
Put a server on 10.10.10.0/24 with explicit routing and DNS.
Example 3: VLAN (netdev + network)
Create VLAN 20 on top of enp3s0 and assign a static address to the VLAN interface.
Example 4: Bridge (common on servers/VM hosts)
Create br0, attach enp4s0 to it, and put DHCP on the bridge.
Comprehensive Example: DHCP Server with systemd-networkd (router-style)
Scenario: this host has two interfaces:
WAN = enp1s0 (gets internet via DHCP)
LAN = enp2s0 (serves clients on 192.168.50.0/24)
It will: assign a static LAN IP, run a DHCPv4 server on LAN, and NAT LAN traffic out to WAN.
Notes for real environments:
• DHCPServer=yes is DHCPv4 server (not a full “enterprise DHCP suite”).
• If your distro uses lease persistence, DHCP server start can depend on networkd persistent storage readiness; using PersistLeases=runtime avoids waiting (at the cost of losing leases on reboot).
Command Quick Reference
Interaction with `systemd` is primarily handled through `systemctl` and other related utilities. This section provides a searchable list of common commands for managing units and the system itself. Use the search box to quickly find the command you need for tasks like starting services, checking logs, or analyzing boot performance.