systemd and netconsole
(too old to reply)
don fisher
2018-10-27 21:53:03 UTC
I am running opensuse 42.3 with a 4.18.7 kernel. Below is my setup.
First the kernel command line:


and then my receiving script:

sudo nc -v -u -l 64001 | tee netconsole.log

In summary, netconsole works fine, up to a point where it hangs at
around 12us after boot. Before the hang the destination output matches
that presented by dmesg. I also looked using journalctl and find that
there are many systemd messages, I guess as expected. The netconsole
output terminates after systemd messages. The last message transmitted
by netconsole is:

kernel: NFSD: starting 90-second grace period (net f00000a8)

It is hard to estimate now many systemd messages are in the journal
because there are "Journal stopped" messages where I assume there is a
data overrun error. But there are many.

It appears that netconsole works well maybe until systemd starts
logging. I think I read in "Rethinking PID 1" that systemd sets up
logging, I assume by connecting to printk. Can you help me with this
connection? I also see systemd messages about setting up vconsole, but
do not know if there is a conflict. I do not know what code systemd uses
to connect to printk, or what it should try and do. netconsole connects
to printk with a "register_console (&netconsole_ext)". Is this
connection possibly broken by the systemd startup? I search the kernel
list and find that may people are using netconsole, so I am confident
there is a way to make it work.

Please advise if you have any ideas on how to proceed. I can post log
files if there is space. I am also willing to run any experiments.

Thanks. I have tried many lists including kernel and newbie-kernel, and
have received no response.

Lennart Poettering
2018-10-29 14:32:48 UTC
Thanks. I have tried many lists including kernel and newbie-kernel, and have
received no response.
I have no experience with netconsole, but maybe it's simple the
passive-agressive log throttling the kernel folks implemented? Current
upstream kernels enforce a strict ratelimit on userspace logging, see
printk.devkmsg= kernel cmdline option.

journald writes logs to /dev/kmsg during early boot when there's
nowhere else to write.

Lennart Poettering, Red Hat
Continue reading on narkive: