How to get kernel crash log in /var/log/messages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get kernel crash log in /var/log/messages

482 Views
bandarulavanya
Contributor V

Hi Friends,

I want to get kernel crash log in /var/log/messages to take back up.

I am doing in run script like below

cat /var/log/messages > /home/Crash.log

sleep 1

klogd &

syslogd &

so now after board is booted i will get previous messages in /home/Crash.log and present messages in /var/log/messages.  I am creating kernel panic using "echo c > /proc/sysrq-trigger"

after reboot i am getting the kernel log up to last message before panic, so how can i get crash details also, for this am i need to enable any configurations in kernel menuconfig. If any one knows kindly give information.

Thanks & Regards,

Lavanya.B

Tags (2)
0 Kudos
2 Replies

132 Views
b36401
NXP TechSupport
NXP TechSupport

You can add into /etc/sysctl.conf file the line like this:

kernel.core_pattern = /var/log/core

Have a great day,

Victor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

132 Views
bandarulavanya
Contributor V

Hi Victor,

Thank you , I added  kernel.core_pattern = /var/log/core in /etc/sysctl.conf and i created panic using echo c > /proc/sysrq-trigger but after reboot i have not seen any messages in /var/log/core or /var/log/messages. To get crash log in to file we need to select any kernel configurations from menuconfig.

Thanks & Regards,

Lavanya.B

0 Kudos