[systemd-devel] [HEADSUP] kmsg changes

Lennart Poettering lennart at poettering.net
Thu Mar 31 11:10:53 PDT 2011


Heya,

Just wanted to mention that systemd git now logs its own messages with
facility=LOG_DAEMON to kmsg, and messages from processes it spawns with
LOG_USER. It will no longer strip the facilities passed in from daemons.

The net effect should be that all log messages routed through systemd to
kmsg will now have a facility != 0. That means they can be recognized as
non-kernel messages in syslog implementations and in (future versions
of) dmesg.

Unfortunately some software has problems with the full facility value on
those log messages.

Most notably the kernel formats kmsg timestamps badly if we log like
this. This is fixed with this patch.

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d90c8d9cde929cbc575098e825d7c29d9f45054

This patch is backported to the F15 kernel, and the current Suse kernel
already, and is also already in Linus' kernel and hence will be part of
the next official kernel too. You might want to backport this into your
kernel as well. If you don't however, nothing bad will happen. The
messages will just look a bit weird when you type "dmesg", but not
unreadable.

rsyslog has been update to parse correctly even these weird messages. So
even on an unpatched kernel the messages routed via systemd and kmsg
will appear properly formatted. Thanks a lot to Rainer for implementing
this.

Note that current udev logs proper facility messages now too, and dracut
soon as well.

Why this all? So that people have a simple way to distuingish kernel
from userspace messages in dmesg. And it's standards compliant even, how
awesome is that?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list