journal: include kmsg lines from the systemd process which exec()d us (#8078)
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Mon, 5 Feb 2018 16:53:40 +0000 (16:53 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 5 Feb 2018 16:53:40 +0000 (17:53 +0100)
commitfe167298681ccc0292b72a03ba82889792a1c982
treea118985d069adfe877a69fe7aed81d50e514bc40
parent0e3c6bf0cefa018129a1000327fa9056b145da0c
journal: include kmsg lines from the systemd process which exec()d us (#8078)

Let the journal capture messages emitted by systemd, before it ran
exec("/usr/lib/systemd/systemd-journald").  Usually such messages will only
appear with `systemd.log_level=debug`.  kmsg lines written after the exec()
will be ignored as before.

In other words, we are avoiding reading our own lines, which start
"systemd-journald[100]: " assuming we are PID 100.  But now we will start
allowing ourself to read lines which start "systemd[100]: ", or any other
prefix which is not "systemd-journald[100]: ".

So this can't help you see messages when we fail to exec() journald :). But,
it makes it easier to see what the pre-exec() messages look like in
the successful case.  Comparing messages like this can be useful when
debugging.  Noticing weird omissions of messages, otoh, makes me anxious.
src/journal/journald-kmsg.c