Fwd: syslogd kernel messages facility

Sergey Naumov sknaumov at gmail.com
Tue Nov 23 11:14:21 UTC 2010


It seems that it is glibc/uclibc bug, because in busybox's klogd we
call syslog(priority, "%s", start) with priority <=7 (so facility is
zero), but uclibc code (0.9.30.2) for syslog function uses default
LOG_USER facility for these messages. Even specifying LOG_KERN in
openlog("kernel", 0, LOG_KERN)  in klogd.c does not help:
...
static int LogFacility = LOG_USER;

void openlog(..., int logfac)
{
...
    if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0)
        LogFacility = logfac;
...
}

In this function zero facility is treated like "unspecified", but in
fact zero facility is LOG_KERN facility.

In uclibc 0.9.31 it is fixed, but for glic-2.7 from debian 5.0.0 lenny
I see incorrect behavior. May be we should make an ugly optional
workaround and use in klogd some reserved facility value (for example,
LOG_LOCAL7 or smth) for LOG_KERN, and then restore correct facility
number in syslogd? Does anybody know, how often LOG_LOCAL[0-7] are
used and whether it is safe to use them for workaround purpose?

Sergey Naumov.


More information about the busybox mailing list