<div dir="ltr"><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, Feb 24, 2025 at 10:25 PM Thomas HUMMEL <<a href="mailto:thomas.hummel@pasteur.fr">thomas.hummel@pasteur.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I'm running systemd-239-74 on RHEL 8.8. EUS.<br>
I'm using dracut initialramfs running systemd to PXE boot stateless <br>
compute nodes.<br>
<br>
In real-root image, journald is set up to forward to syslog <br>
(ForwardToSyslog=yes) which is handled by rsyslogd to aggregate on a log <br>
server logs from nodes.<br>
<br>
So I can see in those logs kernel booting messages (starting with<br>
<br>
kernel: [    0.000000] Linux version 4.18.0-477.43.1.el8_8.x86_64 <br>
(<a href="mailto:mockbuild@x86-vm-07.build.eng.bos.redhat.com" target="_blank">mockbuild@x86-vm-07.build.eng.bos.redhat.com</a>) (gcc version 8.5.0 <br>
20210514 (Red Hat 8.5.0-18) (GCC)) #1 SMP Thu Jan 4 10:30:57 EST 2024<br></blockquote><div><br></div><div>These seem like rsyslogd has picked them up directly from the kernel (from the legacy /proc/kmsg guessing from the format) and not from the journal. Systemd-journald loads kernel logs via /dev/kmsg which wouldn't have the [time.stamp] prefix.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I also sometimes used dracut debug mode and initialramfs journald as <br>
stated in the man:<br>
<br>
" rd.debug<br>
            set -x for the dracut shell. If systemd is active in the<br>
            initramfs, all output is logged to the systemd journal, which<br>
            you can inspect with "journalctl -ab". "<br>
<br>
I was wondering :<br>
<br>
1. is initialramfs journald able to somehow handle its logs to actual <br>
root systemd and if so how ? (my understanding was that, for instance, <br>
such a mechanism was a reason to use dracut NetworkManager (as opposed <br>
to legacy module) module if/when using NetworkManger in actual root)<br></blockquote><div><br></div><div>I believe it just logs to /run/log and the initramfs needs to carry over the same /run tmpfs mount to the "real root" phase, where "flush to /var" picks up both initramfs logs and early rootfs logs at the same time. At least that's how it seems to work with Arch's systemd-based mkinitcpio initramfs.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
2. would then initialramfs output also be forwarded to syslog ? Only in <br>
debug mode ?<br></blockquote><div><br></div><div>ForwardToSyslog is not retroactive. You'd need to use the pull method (rsyslogd's imjournal module) to have it forward old messages.</div><div><br></div></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>