Bug 585533 - /usr/bin/logger silently redirects logging for "kern" facility to "user" facility
Summary: /usr/bin/logger silently redirects logging for "kern" facility to "user" faci...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: util-linux
Version: 5.7
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-24 15:17 UTC by David Tonhofer
Modified: 2010-04-27 06:33 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-04-26 07:05:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description David Tonhofer 2010-04-24 15:17:52 UTC
Description of problem:

Run something like this:

-------------
for FACIL in auth authpriv cron daemon ftp kern lpr mail \
             news syslog user uucp local0 local1 local2 local3 \
             local4 local5 local6 local7; do
   for LEVEL in alert crit debug emerg err info notice warning; do
      /usr/bin/logger -t TESTING -p ${FACIL}.${LEVEL} \
                      "Test message at ${FACIL}.${LEVEL}"
   done
done
------------

with a syslog.conf like this:

--------------------
auth.*          -/var/log/auth_log
authpriv.*      -/var/log/authpriv_log
cron.*          -/var/log/cron_log
daemon.*        -/var/log/daemon_log
kern.*           /var/log/kern_log
lpr.*           -/var/log/lpr_log
mail.*          -/var/log/mail_log
news.*          -/var/log/news_log
user.*          -/var/log/user_log
uucp.*          -/var/log/uucp_log
ftp.*           -/var/log/ftp_log
syslog.*        -/var/log/syslog_log
local0.*        -/var/log/local0_log
local1.*        -/var/log/local1_log
local2.*        -/var/log/local2_log
local3.*        -/var/log/local3_log
local4.*        -/var/log/local4_log
local5.*        -/var/log/local5_log
local6.*        -/var/log/local6_log
local7.*        -/var/log/local7_log
--------------------

Notice how all the messages go to the correct logfile, except the ones for the facility "kern", which silently go to facility "user"

Version-Release number of selected component (if applicable):

util-linux-2.13-0.52.el5_4.1

How reproducible:

Always

Comment 1 Karel Zak 2010-04-26 07:05:25 UTC
man 3 syslog:

  LOG_KERN    kernel messages (these can’t be generated from user processes)

Comment 2 David Tonhofer 2010-04-26 15:04:17 UTC
Zut alors.

The Ubuntu manpage for syslog.conf is even more precise:

>  In most cases anyone can log to any facility, so we rely on  convention
>  for  the  correct  facility  to be chosen.  However, generally only the
>  kernel  can  log  to  the  "kern"  facility.   This  is   because   the
>  implementation  of  openlog()  and  syslog()  in  glibc  does not allow
>  logging to the "kern" facility.   Klogd  circumvents  this  restriction
>  when logging to syslogd by reimplementing those functions itself.

but in that case, would it be useful to 

- add a corresponding remark to the manpage of the "logger" command

  and/or

- make "logger" warn about messages directed to "kern" facility (might break
  existing scripts though)

Comment 3 Karel Zak 2010-04-27 06:33:02 UTC
(In reply to comment #2)
> Zut alors.
> - add a corresponding remark to the manpage of the "logger" command

 Good point. Added to the upstream tree. Thanks.


Note You need to log in before you can comment on or make changes to this bug.