]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: delete redundant log_parse_environment() 39278/head
authorhuyubiao <huyubiaox@gmail.com>
Tue, 30 Sep 2025 07:26:43 +0000 (15:26 +0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 15 Oct 2025 12:00:45 +0000 (14:00 +0200)
commit8f2c5dea63b43c85628e5ced045f5f8a24cfffc4
tree24ed621c2feac4c16e407f3877cdc62a5d36658c
parent938f7fea7c953e5f5e9e199a5fcd22ac84fd1240
core: delete redundant log_parse_environment()

Fixes https://github.com/systemd/systemd/issues/38895.

Fix the confusing behavior where when an incorrect configuration item such as
'ManagerEnvironment=SYSTEMD_LOG_LEVEL=' is set, the first daemon-reload uses
old environment variables while the second daemon-reload uses LogLevel=.

Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
The difference in behaviour is that the operations that were done between the
first log_parse_environment() and the second one might not be logged now, e.g.
if the environment enabled debug logging. That is unfortunate, but parsing the
environment twice and not having the explicit configuration take effect until a
second daemon-reload is confusing. We will always have some window where the
configuration for logging does not apply, in particular this must be true when
parsing the logging configuration. To make that window smaller, move operations
that could log after the call to log_parse_environment() as far as possible.
src/core/main.c