Subject: [bug#30498] [WIP v2 shepherd] shepherd: If /dev/kmsg is writable, use it for logging.

From: [email-masked] (Ludovic Courtès)
Date: Mon, 05 Mar 2018 17:51:44 +0100

Heya,

I took the liberty to split this in several patches, which I think makes
it easier to follow.  I omitted the bits about redirecting stderr, for
now, to simplify things.

I tested it in a GuixSD VM and it works as advertised!  \o/

There’s one thing we need to improve though: syslogd reads /proc/kmsg
and prefixes everything that comes from there with “vmunix” (as if it
came from the kernel).  That’s inconvenient because it makes it
impossible to have syslogd rules to filter shepherd messages.

So I think we need to do instead use a ‘syslog’-style interface and,
similar to what ‘syslog’ does in glibc, write to /dev/log unless it’s
unavailable, in which case we fall back to /dev/kmsg.

Thoughts?

I’ll see if I can give it a try.

Thanks,
Ludo’.