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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

1,776件の閲覧回数
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,426件の閲覧回数
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,426件の閲覧回数
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 件の賞賛
返信