brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: systemd-analyze cat-config shows a systemd config with all its drop-ins

Systemd
~/tips/tip-systemd-cat-config

systemd-analyze cat-config systemd/journald.conf

Read the full effective config of journald, logind or resolved in one place.

Config files like journald.conf can be split over /etc, /run and /usr/lib, with drop-ins in .conf.d folders. When you are unsure which setting wins, I’d let systemd show the lot.

systemd-analyze cat-config systemd/journald.conf
systemd-analyze cat-config systemd/logind.conf

The path is relative to the config directories, so leave off /etc. The output prints the main file and then every drop-in, each starting with a comment that has its full path, like # /etc/systemd/journald.conf. That header is the useful bit: you see exactly which file each line came from.

It works for many other files too, such as systemd/system.conf, systemd/resolved.conf and directories like tmpfiles.d or sysctl.d, where it prints every file in the order they are applied.

To filter out the comment lines from the defaults:

systemd-analyze cat-config systemd/journald.conf | grep -v '^#'

This shows the files, not the values the daemon is using right now. If you edited something and did not restart the service, the file looks right while the old setting is still active. For units, systemctl cat is the equivalent command.

Further reading: systemd-analyze man page

More Systemd tips [Service] sudo mkdir -p /etc/systemd/system/service.d [Service] printf 'hunter2' | sudo systemd-creds encrypt --name=dbpass – dbpass.cred systemd-analyze timespan 1h30min All Systemd tips (88) All topics

Link