Kernel Panic!
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.
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.
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.
Based on what error messages you see you can google around to hopefully find a concise accurate solution to your problem.
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
Code:
grep -iHn 'shutdown\|poweroff\|panic' /var/log/shutdown.err | cut -d: -f2
Code:
less +498 /var/log/shutdown.err vim +498 /var/log/shutdown.err
Total Comments 0