Bug 585533 - /usr/bin/logger silently redirects logging for "kern" facility to "user" facility
/usr/bin/logger silently redirects logging for "kern" facility to "user" faci...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: util-linux (Show other bugs)
5.7
All Linux
low Severity medium
: rc
: ---
Assigned To: Karel Zak
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-24 11:17 EDT by David Tonhofer
Modified: 2010-04-27 02:33 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-04-26 03:05:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Tonhofer 2010-04-24 11:17:52 EDT
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 03:05:25 EDT
man 3 syslog:

  LOG_KERN    kernel messages (these can’t be generated from user processes)
Comment 2 David Tonhofer 2010-04-26 11:04:17 EDT
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 02:33:02 EDT
(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.