summaryrefslogtreecommitdiffstats
path: root/src/journal-remote
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-02-22 10:50:05 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-03-07 19:14:36 +0100
commit6378f257e7e7856abc32cd9b5cb33bc4c63903be (patch)
treed0e7cb675bf137a91b5277a726e43b091cede105 /src/journal-remote
parentshared/conf-parser: add function which implements the standard config file set (diff)
downloadsystemd-6378f257e7e7856abc32cd9b5cb33bc4c63903be.tar.xz
systemd-6378f257e7e7856abc32cd9b5cb33bc4c63903be.zip
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.
Diffstat (limited to 'src/journal-remote')
-rw-r--r--src/journal-remote/journal-remote-main.c9
-rw-r--r--src/journal-remote/journal-upload.c9
2 files changed, 12 insertions, 6 deletions
diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c
index 221b544fbc..91cb2eefaa 100644
--- a/src/journal-remote/journal-remote-main.c
+++ b/src/journal-remote/journal-remote-main.c
@@ -746,9 +746,12 @@ static int parse_config(void) {
{}
};
- return config_parse_config_file("systemd/journal-remote.conf", "Remote\0",
- config_item_table_lookup, items,
- CONFIG_PARSE_WARN, NULL);
+ return config_parse_standard_file_with_dropins(
+ "systemd/journal-remote.conf",
+ "Remote\0",
+ config_item_table_lookup, items,
+ CONFIG_PARSE_WARN,
+ /* userdata= */ NULL);
}
static int help(void) {
diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c
index 6d080d7370..327b7bacd7 100644
--- a/src/journal-remote/journal-upload.c
+++ b/src/journal-remote/journal-upload.c
@@ -531,9 +531,12 @@ static int parse_config(void) {
{}
};
- return config_parse_config_file("systemd/journal-upload.conf", "Upload\0",
- config_item_table_lookup, items,
- CONFIG_PARSE_WARN, NULL);
+ return config_parse_standard_file_with_dropins(
+ "systemd/journal-upload.conf",
+ "Upload\0",
+ config_item_table_lookup, items,
+ CONFIG_PARSE_WARN,
+ /* userdata= */ NULL);
}
static int help(void) {