Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 189597 - klogd always sets console_loglevel
klogd always sets console_loglevel
Status: CLOSED NEXTRELEASE
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: sysklogd (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-21 10:50 EDT by Jarett Stevens
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-02 08:30:27 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)
Universal diff (17.80 KB, text/plain)
2006-04-21 10:50 EDT, Jarett Stevens
no flags Details

  None (edit)
Description Jarett Stevens 2006-04-21 10:50:28 EDT
Description of problem:
klogd does not respect the existing value for console_loglevel (this is the
first number displayed with "sysctl kernel.printk" or if you cat
/proc/sys/kernel/printk).  

Version-Release number of selected component (if applicable):
sysklogd-1.4.1rh (from sysklogd-1.4.1-26_EL3.src.rpm)

How reproducible:
Always

Steps to Reproduce:
1. Modify kernel.printk in /etc/sysctl.conf ; ex: "kernel.printk = 4 4 1 7"
2. Reboot
3. Check the value of kernel.printk after logging in, "sysctl kernel.printk"
  
Actual results:
Unless modified with the "-c" option to klogd, which would be defined in
/etc/sysconfig/syslog, the value of kernel.printk is "6 4 1 7"

Expected results:
The value of kernel.printk should be what was set in /etc/sysctl.conf, "4 4 1 7"

Additional info:
(from Red Hat support ticket 871670)

By default, klogd resets the default console output level to "6" (this is the
first number of the parameter).  This can be changed to any value by modifying
the option line in /etc/sysconfig/syslog; ex:
KLOGD_OPTIONS="-x -c 4" 

The problem lies in the source; the SRPM is sysklogd-1.4.1-26_EL3.src.rpm
 
After extracting /usr/src/redhat/SOURCES/sysklogd-1.4.1rh.tar.gz you can see the
problem in /sysklogd-1.4.1rh/klogd.c
 
If you don't explicitly set the default log level with the "-c" option (lines
1005-1007, 1045-1057), then it remains at a staticly-set value of "6" (line 298)
when actually set (lines 515-517)
 
 
298                 console_log_level = 6;
...
 
515         /* Set level of kernel console messaging.. */
516         if ( (ksyslog(8, NULL, console_log_level) < 0) && \
517              (errno == EINVAL) )
...
 
1005                     case 'c':           /* Set console message level. */
1006                         log_level = optarg;
1007                         break;
...
 
1045         /* Set console logging level. */
1046         if ( log_level != (char *) 0 )
1047         {
1048                 if ( (strlen(log_level) > 1) || \
1049                      (strchr("12345678", *log_level) == (char *) 0) )
1050                 {
1051                         fprintf(stderr, "klogd: Invalid console logging "
1052                                 "level <%s> specified.\n", log_level);
1053                         return(1);
1054                 }
1055                 console_log_level = *log_level - '0';
1056         }
1057 

A quick search on Google and a review of the changelog for sysklogd indicates
that Red Hat is not actually using the 1.4.1 version (for RH named 1.4.1rh), or
at least not the one from the project site where this is already corrected.
 
http://www.infodrom.org/projects/sysklogd/
 
I have also attached a universal diff.
Comment 1 Jarett Stevens 2006-04-21 10:50:28 EDT
Created attachment 128088 [details]
Universal diff
Comment 4 Peter Vrabec 2007-08-02 08:30:27 EDT
fixed in RHEL4,5, ...

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