core: Parse log environment settings again after applying manager environment
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 7 Sep 2021 15:13:56 +0000 (16:13 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 12 Oct 2021 14:51:51 +0000 (16:51 +0200)
Currently, SYSTEMD_LOG_LEVEL set in the ManagerEnvironment property in system.conf
or user.conf doesn't affect the manager's logging level. Parsing the logging environment
variables again after pushing the manager environment into the process environment
block makes sure any new environment changes also get taken into account for logging.

(cherry picked from commit a4303b4096d9a75acd09c5b897ed3d20c9bca6de)

src/core/main.c

index b32a19a1d8888067cde05bfa074bb6fc0a2a1c7c..c64c73883e68da9f388851f5cf6f1fe06ce0e6aa 100644 (file)
@@ -2454,6 +2454,9 @@ static int parse_configuration(const struct rlimit *saved_rlimit_nofile,
         /* Push variables into the manager environment block */
         setenv_manager_environment();
 
+        /* Parse log environment variables again to take into account any new environment variables. */
+        log_parse_environment();
+
         return 0;
 }