]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-config: restore log level set by systemd.log_level on reload
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 7 Apr 2025 21:26:12 +0000 (06:26 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 8 Apr 2025 23:57:12 +0000 (08:57 +0900)
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

index 31611ece6414020aa73c1bcbdfbe6f3fae511f78..142f19e1b14aa326b58e2b02e1e71c0a9efd8a0a 100644 (file)
@@ -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);