This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: syslog and LOG_KERN broken


> 
> The Solaris 2.6 and BSD man pages for syslog() clearly state that LOG_KERN
> messages ``cannot be generated by any user processes''.  So the
> current implementation is fine.
> 
> Removing the check in openlog_internal is not an option, since that
> clearly brakes binary compatibility.  LOG_USER is explicitly
> documented as the default.
> 
> Giving LOG_KERN a different value breaks binary compatibility too.
> The argument that it never worked is bogus, since it is not supposed
> to have ever worked in combination with openlog().  But it is a valid
> argument for messages generated (by the kernel) in a different way.
> 
> I think the idea is that klogd is supposed to be that other way of
> generating messages.  IIRC it reads messages from /dev/klog and
> forwards them to syslog.  It cannot use openlog()/syslog()/closelog()
> from glibc and therefore provides its own (possibly simplified)
> implementation of syslog().  Werner seems to have been trying to
> replace that private implementation with the one in glibc, and that
> simply won't work.
> 
> On my own system I use a BSD syslogd (from NetBSD I believe) which
> reads directly from /dev/klog and this works fine.
> 
> Conclusion: I don't think there is a bug other than the fact that
> syslog() is undocumented.

Hmmm ... the klogd of sysklogd-1.3-33 has its own syslog() which is
a copy of an older syslog() libc5/glibc together with one change, make
ist possible to use LOG_KERN.  This means that we use duplicated code
here which is not very useful.  Maybe it would be nice to have a switch
only for compiling and linking a klogd with glibc based syslog().
The klogd under Linux reads from /proc/kmsg and forward the kernel
messages via syslog() to syslogd.


         Werner

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]