Friday, August 13, 2010

Linux Kernel panic reboot

By default after a kernel panic Linux just waits there for a sysadmin to hit the restart or powercycle button.  This is because of the value set on "kernel.panic" parameter.

[root@linux23 ~]# cat /proc/sys/kernel/panic
0
[root@linux23 ~]# sysctl -a | grep kernel.panic
kernel.panic = 0
[root@linux23 ~]#

To disable this and make the Linux OS reboot after a kernel panic, we have to set an integer N greater than zero to the paramter "kernel.panic", where "N" is the number of seconds to wait before a automatic reboot.  For example , if you set N = 10 , then the system waits for 10 seconds before automatic reboot. To make this permanent, edit /etc/sysctl.conf and set it.

[root@linux23 ~]# echo "10" > /proc/sys/kernel/panic
0
[root@linux23 ~]# grep kernel.panic /etc/sysctl.conf
kernel.panic = 10
[root@linux23 ~]#

5 comments:

KPR said...
This comment has been removed by the author.
KPR said...

I have to appreciate you for writing some good stuff in your blog.Thanks for your time to write all this things.

Keep up your good work.It will help someone surely.I am Ravi from usa working as UNIX/San admin...

Takecare
Ravi

Anonymous said...

But why would you want to do this ?
the whole point in unix/linux "just sitting" there is so that the "sysadmin" can note down the last message onscreen before the kernel Panic before hitting reboot

if you are unlucky as i have been before and each time you reboot you recieve a different error message then you will miss the first - second and so on errors possibly making the "real" problem hard to find indead

but as for ease of use thums up for this cause somtimes i wish my box had just restarted after that panic casued buy a late HD read on boot

zanne said...

Hi Satish

your site is fantastic mate, I'm a unix AIX administrator working in Australia for 13 years now doing AIX-HACMP-PowerVM etc etc.

I'm wondering if you can assist me and guide me how best I can find jobs in UAE as I'm seriously looking forward to move.

Any help would be greatly appreciated.
I can send you my email later on so we can better communicate if you deem appropriate.

Any good websites for aix unix jobs etc ?

Looking forward to hearing from you mate.

Regards

zanne said...

Hi Satish

Your site is great, just wondering if you can assist me in something.

Im a unix AIX admin and doing aix in Australia for 13 years now, this involves indepath experience with AIX PowerVM, designing, hacmp clusters etc etc.
I'm a citizen here but now looking forward to move down to anywhere in UAE whereever I can get a job in AIX due to family matter I need to make a move soon.

Any good websites for unix-aix jobs or how best I can apply and look for jobs.

any help would be greatly appreciated mate.

I look forward to hearing from you.

Regards

Zanne