From 4cd9f59b867c74e03196a5aacd3d4bace46a1bc3 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 8 Apr 2025 06:26:12 +0900 Subject: [PATCH] udev-config: restore log level set by systemd.log_level on reload If previously log level was specified in udev.conf but not now, then let's make 'udevadm control --reload' sets the log level specified by systemd.log_level. --- src/udev/udev-config.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/udev/udev-config.c b/src/udev/udev-config.c index 31611ece641..142f19e1b14 100644 --- a/src/udev/udev-config.c +++ b/src/udev/udev-config.c @@ -20,6 +20,7 @@ #define WORKER_NUM_MAX UINT64_C(2048) +static int default_log_level = LOG_INFO; static bool arg_debug = false; bool arg_daemonize = false; @@ -279,7 +280,7 @@ static void manager_merge_config_log_level(Manager *manager) { if (manager->config.trace) manager->config.log_level = LOG_DEBUG; else - MERGE_NON_NEGATIVE(log_level, log_get_max_level()); + MERGE_NON_NEGATIVE(log_level, default_log_level); } static void manager_merge_config(Manager *manager) { @@ -441,6 +442,8 @@ int manager_load(Manager *manager, int argc, char *argv[]) { assert(manager); + default_log_level = log_get_max_level(); + manager_parse_udev_config(&manager->config_by_udev_conf); r = parse_argv(argc, argv, &manager->config_by_command); -- 2.47.3