How to Inspect Layered Configuration Drop-ins in Ubuntu Using systemd-analyze cat-config

In modern Ubuntu and systemd-based Linux environments, system daemons and core subsystems are configured through layered configuration directories. Rather than storing configuration settings in a single monolithic text file, systemd employs a tiered directory hierarchy spanning vendor distribution defaults (under /usr/lib/systemd/), local administrator configurations (under /etc/systemd/), runtime volatile overrides (under /run/systemd/), and drop-in configuration snippets (within *.d/ subdirectories). While this modular approach allows software packages and automation tools to inject granular modifications without clobbering upstream defaults, it can obscure which directive is actively applied. To inspect the final synthesized configuration and trace every participating file in precedence order, Ubuntu provides the systemd-analyze cat-config command.

Understanding systemd Layered Configuration Precedence

When a systemd daemon—such as the service manager, systemd-journald, systemd-resolved, systemd-logind, or systemd-timesyncd—initialises, it parses configuration files in a strictly defined precedence order:

  1. Runtime Volatile Overrides (/run/systemd/): Ephemeral configurations generated during the current boot cycle by early-boot generators, cloud-init scripts, or transient processes. These take highest priority over static disk configurations.
  2. Local Administrator Overrides (/etc/systemd/): Persistent local modifications defined by system administrators. Files and drop-in directories here override vendor files with matching names.
  3. Vendor Distribution Defaults (/usr/lib/systemd/): Upstream defaults shipped by Ubuntu maintainers and package repositories. These should never be edited directly, as package upgrades will overwrite manual edits.
  4. Drop-in Directories (*.conf.d/): Within each level, auxiliary drop-in snippets located in foo.conf.d/*.conf are parsed in lexicographical order (sorted numerically and alphabetically, e.g., 10-timeout.conf, 50-storage.conf).

Inspecting Core Daemon Configurations with cat-config

The systemd-analyze cat-config utility examines a specified configuration file name across all search paths, concatenates all active base files and drop-in overrides, and outputs them clearly annotated with file path headers.

Inspecting systemd System Manager Configuration

To inspect the unified configuration governing global service limits, default timeouts, and watchdog intervals:

systemd-analyze cat-config systemd/system.conf

The output begins with the baseline file followed by all active drop-ins:

# /usr/lib/systemd/system.conf
# This file is part of systemd.
# ... default vendor configuration ...
[Manager]
DefaultTimeoutStartSec=90s
DefaultTimeoutStopSec=90s

# /etc/systemd/system.conf.d/10-custom-timeouts.conf
[Manager]
DefaultTimeoutStopSec=15s

By reviewing the concatenated output, administrators can immediately determine that DefaultTimeoutStopSec has been overridden to 15s by the drop-in file in /etc/systemd/system.conf.d/.

Inspecting Journal Logging Daemon Configuration

To audit log storage policies, memory limits, and disk retention settings parsed by systemd-journald:

systemd-analyze cat-config systemd/journald.conf

This command lists the main /etc/systemd/journald.conf file along with any active drop-ins residing in /etc/systemd/journald.conf.d/*.conf or /usr/lib/systemd/journald.conf.d/*.conf, surfacing parameters like Storage=persistent or SystemMaxUse=2G.

Inspecting DNS Resolver Configurations

To verify the consolidated configuration of the local caching resolver systemd-resolved:

systemd-analyze cat-config systemd/resolved.conf

This reveals custom DNS upstream servers, DNS over TLS (DoT) directives, fallback DNS resolvers, and multicast DNS parameters consolidated across all active drop-ins.

Using Command Flags for Targeted Configuration Audits

The systemd-analyze cat-config tool provides flags to alter how search paths and file trees are inspected.

Filtering Out Comments and Empty Lines

Standard vendor configuration templates often contain hundreds of lines of commented documentation. To strip comments and display only active directives:

systemd-analyze cat-config --no-pager systemd/logind.conf | grep -E '^\[|^[a-zA-Z]'

Inspecting Specific Subsystem Trees

You can query configuration files for arbitrary subsystems, including kernel core dumps, sleep states, and time synchronisation:

# Inspect systemd-coredump configuration
systemd-analyze cat-config systemd/coredump.conf

# Inspect systemd-timesyncd NTP configuration
systemd-analyze cat-config systemd/timesyncd.conf

# Inspect system power and sleep configuration
systemd-analyze cat-config systemd/sleep.conf

Creating Clean Drop-in Overrides Without Breaking Vendor Defaults

Understanding the output of cat-config reinforces best-practice administration: never edit files in /usr/lib/systemd/. Instead, create targeted drop-ins in /etc/systemd/*.conf.d/.

For example, to configure a global default service restart timeout across Ubuntu without editing the core configuration file:

# Create drop-in directory
sudo mkdir -p /etc/systemd/system.conf.d/

# Inject custom configuration snippet
sudo bash -c 'cat <<EOF > /etc/systemd/system.conf.d/20-fast-restart.conf
[Manager]
DefaultRestartSec=2s
DefaultTimeoutStopSec=10s
EOF'

# Validate the applied change using cat-config
systemd-analyze cat-config systemd/system.conf

The output will show 20-fast-restart.conf appended at the end of the configuration stream, guaranteeing its directives take precedence.

Verifying Systemd Reload and Runtime Evaluation

After validating your configuration overrides with systemd-analyze cat-config, instruct systemd to reload its configuration state into daemon memory:

# Reload daemon manager configuration
sudo systemctl daemon-reexec

# If modifying a secondary daemon like journald or resolved:
sudo systemctl restart systemd-journald

By using systemd-analyze cat-config, Ubuntu administrators can debug complex multi-layered configurations, eliminate configuration guesswork, and maintain clean, upgrade-safe infrastructure configurations.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.