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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

1,792 次查看
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

标记 (2)
0 项奖励
回复
2 回复数

1,442 次查看
b36401
NXP Employee
NXP Employee

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 项奖励
回复

1,442 次查看
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 项奖励
回复