]> git.ipfire.org Git - thirdparty/systemd.git/commit
various: use new config loader instead of config_parse_config_file()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 22 Feb 2024 09:50:05 +0000 (10:50 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 7 Mar 2024 18:14:36 +0000 (19:14 +0100)
commit6378f257e7e7856abc32cd9b5cb33bc4c63903be
treed0e7cb675bf137a91b5277a726e43b091cede105
parente7e52ff9b6d6bbfcdcc298ef3c156420b51d58b8
various: use new config loader instead of config_parse_config_file()

This means the main config file is loaded also from /run and /usr.

We should load the main config file from all the places where we load drop-ins.

I realize I had a giant blind spot: I always assumed that we load config files
from /etc, /run, /usr/local/lib, /usr/lib. But it turns out that we only used
those paths for drop-ins. For the main config file, we only looked in /etc. The
docs actually partially described this behaviour, i.e. most SYNOPSIS sections
and some parts of the text, but not others.

This is strange, because 6495361c7d5e8bf640841d1292ef6cfe1ea244cf was completely
bogus with the behaviour before this patch. We had a huge discussion before it
was merged, and clearly nobody noticed this. Similarly, in the previous version
of the current pull request, we had a long discussion about the appropriate
order of directories, and apparently nobody noticed that there was no order,
because only looked in one directory. So the blind spot seems to have been
shared.

Also, systemd-analyze cat-config behaved incorrectly, i.e. its behaviour matches
the new behaviour.

Possibly, in the future it'll make it easier to add support for --root.
16 files changed:
src/core/main.c
src/coredump/coredump.c
src/home/homed-conf.c
src/journal-remote/journal-remote-main.c
src/journal-remote/journal-upload.c
src/journal/journald-server.c
src/login/logind-core.c
src/network/networkd-conf.c
src/oom/oomd.c
src/pstore/pstore.c
src/resolve/resolved-conf.c
src/shared/conf-parser.c
src/shared/conf-parser.h
src/shared/sleep-config.c
src/shared/udev-util.c
src/timesync/timesyncd-conf.c