diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-04-18 13:15:20 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-04-20 13:43:37 +0200 |
commit | d2f57745d543e9981980f502deb55fcedb6767ce (patch) | |
tree | 4498e758ea2d884c3c3e44b9a3fca72e81bf4e09 /src/core | |
parent | e1d8f702a2cacc12978bd7c17e22a8c312404cdf (diff) | |
download | systemd-d2f57745d543e9981980f502deb55fcedb6767ce.tar.gz |
core: Parse logging environment earlier
Let's make sure we parse the logging environment ASAP so that the
options apply to more code. e.g. to allow debugging kmod-setup.c
for example.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/main.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/core/main.c b/src/core/main.c index b627916a25..932ea64e45 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -2798,12 +2798,18 @@ int main(int argc, char *argv[]) { error_message = "Failed to mount early API filesystems"; goto finish; } + } + + /* We might have just mounted /proc, so let's try to parse the kernel + * command line log arguments immediately. */ + log_parse_environment(); - /* Let's open the log backend a second time, in case the first time didn't - * work. Quite possibly we have mounted /dev just now, so /dev/kmsg became - * available, and it previously wasn't. */ - log_open(); + /* Let's open the log backend a second time, in case the first time didn't + * work. Quite possibly we have mounted /dev just now, so /dev/kmsg became + * available, and it previously wasn't. */ + log_open(); + if (!skip_setup) { disable_printk_ratelimit(); r = initialize_security( |