LinuxCommandLibrary

systemd-confext

Manage systemd configuration file snippets

TLDR

View documentation for the original command

$ tldr systemd-sysext
copy

SYNOPSIS

systemd-confext [OPTIONS...] UNIT_FILE...

PARAMETERS

-h, --help
    Show a short help text and exit.

--version
    Show a short version string and exit.

--json=MODE
    Output in JSON format. 'pretty' for human-readable, 'short' for compact, 'off' for default (non-JSON) output. Default is 'off'.

--toplevel=FIELD
    Only show the configuration for the specified top-level field name.

--no-pager
    Do not pipe output into a pager.

--plain
    Print output without line-drawing or other control characters.

--strict
    Abort with an error if unknown fields are encountered in unit files.

--root=PATH
    Operate on a specified root directory instead of the host's root.

--unit-path=PATH
    A colon-separated list of directories to search for unit files.

--dropin-path=PATH
    A colon-separated list of directories to search for drop-in files.

--empty
    Show sections even if they would be empty after parsing.

--full
    Show all fields, not just those explicitly defined or overridden in the unit files. This includes implicit and default values.

--with-dropins
    Explicitly include drop-in configuration files (usually included by default if found).

--section=NAME
    Only show the configuration for a specific section within the unit file, e.g., '[Service]'.

--field=NAME
    Only show the value for a specific field within a specified section, e.g., 'ExecStart'.

DESCRIPTION

systemd-confext is a low-level utility within the systemd suite, designed to extract and display the *effective* configuration of systemd unit files. It processes the specified unit files, including any associated drop-in configuration directories (.d files), and applies the same merging logic that systemd itself uses. This means it resolves overrides and consolidates settings from all relevant configuration sources into a single, cohesive representation.

While not typically invoked directly by end-users, systemd-confext serves as a crucial backend component for tools like systemd-analyze, particularly for its verify and dot subcommands. It allows these tools to accurately inspect and analyze the final state of a unit's configuration, which is essential for debugging, dependency graphing, and understanding how system services are configured and interact. The output is highly structured, often in a machine-readable format, reflecting systemd's internal understanding of the unit's settings.

CAVEATS

systemd-confext is primarily an internal tool for systemd analysis. It is generally not intended for direct interactive use by administrators or users. Its output format, while structured, is optimized for machine parsing rather than easy human readability, especially without the --json=pretty option. Understanding its output requires familiarity with systemd unit file syntax and configuration principles.

INTENDED USE

This command is predominantly used internally by other systemd tools, such as systemd-analyze verify, to parse and understand unit configuration without needing to replicate systemd's complex configuration loading logic. It ensures that any analysis is based on the exact same configuration that systemd itself would use.

CONFIGURATION MERGING

A key function of systemd-confext is to simulate systemd's configuration merging process. This includes handling multiple unit files for the same service (e.g., foo.service and foo.service.d/*.conf), where settings from later files or drop-ins can override or augment those from earlier ones. The output reflects the final, merged configuration.

HISTORY

As an integral part of the systemd project, systemd-confext was developed to provide a standardized and reliable mechanism for extracting and normalizing unit file configurations. Its emergence is tied to the increasing complexity and centrality of systemd in modern Linux distributions. It allows systemd's diagnostic and analysis tools to consistently interpret and represent the effective state of unit files, crucial for validating configurations and troubleshooting service behavior.

SEE ALSO

systemd-analyze(1), systemd.unit(5), systemctl(1), systemd.service(5), systemd.target(5)

Copied to clipboard