Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Between Debian 5 and 6, the default suggested value for kernel.printk in /etc/sysctl.conf was changed from kernel.printk = 4 4 1 7 to kernel.printk = 3 4 1 3. I understand that the first value corresponds to what is going to the console. What are the next 3 values for?

Do the numerical values have the same meaning as the syslog log levels? Or do they have different definitions?

Am I missing some documentation in my searching, or is the only location to figure this out the kernel source.

share|improve this question

1 Answer 1

up vote 8 down vote accepted

Sysctl settings are documented in Documentation/sysctl/*.txt in the kernel source tree. On Debian, install linux-doc to have the documentation in usr/share/doc/linux-doc-*/Documentation/ (most distributions have a similar package). From Documentation/sysctl/kernel.txt:

The four values in printk denote: console_loglevel, default_message_loglevel, minimum_console_loglevel and default_console_loglevel respectively.

These values influence printk() behavior when printing or logging error messages. See man 2 syslog for more info on the different loglevels.

  • console_loglevel: messages with a higher priority than this will be printed to the console
  • default_message_loglevel: messages without an explicit priority will be printed with this priority
  • minimum_console_loglevel: minimum (highest) value to which console_loglevel can be set
  • default_console_loglevel: default value for console_loglevel

I don't find any clear prose explanation of what default_console_loglevel is used for. In the Linux kernel source, the kernel.printk sysctl sets console_printk. The default_console_loglevel field doesn't seem to be used anywhere.

share|improve this answer
1  
This Debian bug 526855, which is the origin of the change, seemed to suggest that there are some conditions where klogd may reset console_loglevel to default_console_loglevel when it calls some kernel function. –  Zoredache May 11 '11 at 20:17
    
@Zoredache: Ah. It did back then, but no longer. The setting only stopped being used in the very kernel version shipped by the current Debian stable, which explains why the setup scripts still support it. –  Gilles May 11 '11 at 20:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.