core: try to reopen /dev/kmsg again right after mounting /dev
authorLennart Poettering <lennart@poettering.net>
Fri, 19 Jul 2019 16:29:11 +0000 (18:29 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 24 Jul 2019 17:56:51 +0000 (19:56 +0200)
commit0a2eef1ee1fef74be9d12f7dc4d0006b645b579c
tree5dcf30b14b61525870cf9de2c140a596a7bfc24d
parentdb8d014f0eecaaa8df9e85a3f7d5306ee5f30b7a
core: try to reopen /dev/kmsg again right after mounting /dev

I was debugging stuff during early boot, and was confused that I never
found the logs for it in kmsg. The reason for that was that /proc is
generally not mounted the first time we do log_open() and hence
log_set_target(LOG_TARGET_KMSG) we do when running as PID 1 had not
effect. A lot later during start-up we call log_open() again where this
is fixed (after the point where we close all remaining fds still open),
but in the meantime no logs every got written to kmsg. This patch fixes
that.
src/core/main.c