LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Blogs > sag47
User Name
Password

Notices

Rate this Entry

Kernel Panic!

Posted 10-16-2010 at 05:30 PM by sag47
Updated 10-16-2010 at 05:31 PM by sag47
Tags syslog

Everybody dreads it. When you see it, it is difficult to know what to do. Luckily Unix provides utilities which allow us to traverse the filesystem and parse files quickly and effortlessly.

Here's a search command which will search all your log files for keywords such as shutdown, poweroff, and panic.

Code:
find /var/log/ -type f -print0 | xargs -0 grep -iH 'shutdown\|poweroff\|panic' | cut -d: -f1 | sort -u
This will allow you to narrow which log files you should be looking at. Once you know which log files you need to look into then you need to grep each one of them to find out which lines the error occurrence shows up within each file. It is best to inspect the files individually. Lets call the file shutdown.err for this example.

Code:
grep -iHn 'shutdown\|poweroff\|panic' /var/log/shutdown.err | cut -d: -f2
Lets say that line 498 showed up in the results. You can use vim or the less pager to view the log at line 498 to see what caused the shutdown error.

Code:
less +498 /var/log/shutdown.err
vim +498 /var/log/shutdown.err
Based on what error messages you see you can google around to hopefully find a concise accurate solution to your problem.
Posted in Uncategorized
Views 816 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 08:43 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