Journald configuration

Combiner for parsing of journald configuration. man journald.conf describes where various journald config files can reside and how they take precedence one over another. The combiner implements the logic and provides an interface for querying active settings.

The journald.conf file is a key=value file with hash comments.

The parsers this combiner uses process only active settings (lines that are not commented out). The resulting settings (after being processed by the precedence evaluation algorithm) are then provided by the get_active_settings_value method and active_settings dictionary and by the get_active_setting_value_and_file_name method and active_settings_with_file_name dictionary.

Options that are commented out are not returned - a rule using this parser has to be aware of which default value is assumed by systemd if the particular option is not specified.

Priority from lowest to highest:

  • built-in defaults (the same as the default commented entries in /etc/systemd/journald.conf)

  • /etc/systemd/journald.conf

  • *.conf in whatever directory in lexicographic order from lowest to highest

  • if two *.conf files with the same name are both in /usr/lib and /etc, the file in /etc wholly overwrites the file in /usr/lib

from man journald.conf in RHEL 7.3:


Default configuration is defined during compilation, so a configuration file is only needed when it is necessary to deviate from those defaults. By default the configuration file in /etc/systemd/ contains commented out entries showing the defaults as a guide to the administrator. This file can be edited to create local overrides.

When packages need to customize the configuration, they can install configuration snippets in /usr/lib/systemd/*.conf.d/. Files in /etc/ are reserved for the local administrator, who may use this logic to override the configuration files installed by vendor packages. The main configuration file is read before any of the configuration directories, and has the lowest precedence; entries in a file in any configuration directory override entries in the single configuration file. Files in the *.conf.d/ configuration subdirectories are sorted by their filename in lexicographic order, regardless of which of the subdirectories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name takes precedence. It is recommended to prefix all filenames in those subdirectories with a two-digit number and a dash, to simplify the ordering of the files.

To disable a configuration file supplied by the vendor, the recommended way is to place a symlink to /dev/null in the configuration directory in /etc/, with the same filename as the vendor configuration file.


>>> conf = shared[JournaldConfAll]
>>> conf.get_active_setting_value('Storage')
>>> 'Storage' in conf.active_settings_with_file_name
>>> conf.get_active_setting_value_and_file_name('Storage')
('auto', '/etc/systemd/journald.conf')
class insights.combiners.journald_conf.JournaldConfAll(journal_conf, journal_conf_d, usr_journal_conf_d)[source]

Bases: object

Combiner for accessing files from the parsers EtcJournaldConf, EtcJournaldConfD, UsrJournaldConfD and evaluating effective active settings based on the rules of file priority and file shadowing as described in man journald.conf.

Can be later refactored to a combiner for parsing all configuration files with key=option lines, like journald files.

Rules of evaluation:

  • Files from EtcJournaldConfD wholly shadow/overwrite files from UsrJournaldConfD with identical names.

  • Files ordered by name from lowest priority to highest (a.conf has lower priority than b.conf).

  • Option values overwritten by the file with the highest priority.

  • The one central file has either the lowest priority or the highest priority, based on the central_file_lowest_prio argument.

That is:

  • An entire file in UsrJournaldConfD is overwritten by a same-named file from EtcJournaldConfD.

  • A single option value is overwritten when another file with a higher priority has an option with the same option name.

Example of file precedence:






the resulting configuration:
    key1=value13 # c.conf has highest priority
    key2=value2 # b.conf from /usr is shadowed by b.conf from /etc so value from a.conf is used
    key4=value4 # b.conf from /usr is shadowed by b.conf from /etc so value from a.conf is used
    key5=value12 # c.conf has higher priority than b.conf
    # key6 doesn't exist because b.conf from /usr is shadowed by b.conf from /etc

Access active setting value by setting name.


setting_name (string) -- Setting name


Access active setting value by setting name. Returns the active setting value and file name of the file in which it is defined. Other files that also specify the setting but are shadowed are ignored and not reported.


setting_name (string) -- Setting name


setting value, file name

Return type:

tuple[str, str]