LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Reply
 
Search this Thread
Old 09-18-2012, 10:33 PM   #1
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 464

Rep: Reputation: 133Reputation: 133
Clean up your LFS boot-time console messages


While some distros hide the kernel and init script messages during booting behind graphics to mesmerize me for those few seconds, I never stopped preferring the old fashioned kernel and init script message spew at boot time.

Did you notice in the transition from LFS v7.0 to v7.1 that what we see on the console screen changed a little? Now, after printing the init script's message to the left and the [ OK ] status to the far right, init-functions backs up the cursor and prints a green asterisk (SUCCESS_PREFIX) to the left of the message text. There are other colored asterisk PREFIX patterns for warnings and failures. I like it.

Anyway, here's what I'm driving at... Somebody (Beekmans, Lucas, Dubbs) went to the trouble to code those script variables in /lib/lsb/init-functions to pretty-up the console screen, but then the kernel comes along and scatters routine informational messages all throughout the pretty init script stuff. And it's mostly useless stuff, too. I mean, who needs to know that the ethernet interface is down before it goes up? I only need to know that it went up, and the pretty network init script message does that. Or, who needs to be reminded of the swap device name by the kernel at the expense of ruining the swap init script's simple message that the swap was activated? The result of this mix of kernel and init script messaging on the console is ugly IMO.
printk_7.JPG
I tried various script hacks here and there to clean up this mess. But here is what I think works best and is by far the easiest to do... change the kernel's printk console_loglevel parameter in /etc/sysctl.conf. The current default value for console_loglevel is 7 which causes the kernel to emit to the console all messaging except debugging messages. Changing that number to 4 eliminates routine informational, normal, and warning messages. You still are informed that everything that needed to be done got done and succeeded. But the visual layout of the information in the console looks much better without being chopped to pieces by less-than-useful kernel jabber.

Here is how to do it. Add these lines to /etc/sysctl.conf...
Code:
# Uncomment the following to stop low-level messages on console
kernel.printk = 4 4 1 7
That first number is console_loglevel. The setting of 4 means that only messages about errors and critical conditions will be sent to the console. Now, when you boot and shutdown, the init script messaging should be much cleaner and you will be deprived of nothing that you really needed to see (IMO).
printk_4.JPG
To see what your current kernel.printk parameters are now, simply cat /proc/sys/kernel/printk. For more about the kinds of kernel messages allowed by the numbered levels and what the other three numbers mean, see the references below.



Some references:
http://www.mjmwired.net/kernel/Docum...ctl/kernel.txt
http://www.linuxjournal.com/article/2365
http://linux.die.net/man/2/syslog



P.S.: This is not new stuff and not the first LQ thread about it. But I didn't find any in the LFS sub-forum or any with very much explanation about the matter. That's what I wanted to add to the record. Mostly.
 
Old 09-28-2012, 11:54 AM   #2
re_nelson
Member
 
Registered: Oct 2011
Location: Texas, USA
Distribution: LFS-SVN, Gentoo-2.2 ~amd64, CentOS-6.5, Slackware64-current, FreeBSD-9.2-STABLE
Posts: 176

Rep: Reputation: Disabled
Quote:
Originally Posted by stoat View Post
Anyway, here's what I'm driving at... Somebody (Beekmans, Lucas, Dubbs) went to the trouble to code those script variables in /lib/lsb/init-functions to pretty-up the console screen, but then the kernel comes along and scatters routine informational messages all throughout the pretty init script stuff. And it's mostly useless stuff, too. I mean, who needs to know that the ethernet interface is down before it goes up? I only need to know that it went up, and the pretty network init script message does that. Or, who needs to be reminded of the swap device name by the kernel at the expense of ruining the swap init script's simple message that the swap was activated? The result of this mix of kernel and init script messaging on the console is ugly IMO.
Thanks for this very useful information. The extraneous messages interspersed with with the actual boot information serves to obscure what's essential. The effort of the LFS team to improve the boot-time look and functionality is appreciated and your tip enhances their work.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No console messages during boot brooko Slackware 11 08-13-2010 05:34 AM
'Lost interrupt' when trying to boot Debian for the first time after clean install Akropolis Linux - Newbie 1 06-12-2008 07:52 PM
Time format in boot-time messages jonr Linux - Kernel 1 12-22-2006 12:31 PM
Logging Console Boot Messages candyman123 Linux - General 5 06-19-2005 02:38 PM
Redirecting console boot messages to different tty. cenkozkan Linux - Software 2 01-17-2004 04:11 AM


All times are GMT -5. The time now is 08:56 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration