星期五, 2月 01, 2008

Auto-reboot Linux after a kernel panic

TechRepublic.com 看到這個方法,幫自己部 Home Server加了這行 statement,希望部機有事可自動 reboot,唔洗太太上唔到網時次次要找我,其實只不過是 reboot 部機。

TechRepublic 的原文;

"Linux is a robust and stable operating system kernel, but there are instances where it can panic, be it due to bad hardware or bad software. It does not happen often, but it can happen.

If you’re running a server or some other always-on system that you may not have easy access to, a kernel panic typically means an inconvenient trip to reboot a system or a phone call to inconvenience someone else. You can, however, configure Linux to automatically reboot on a kernel panic by making a small modification to /etc/sysctl.conf, a configuration file that tweaks many kernel operating parameters.

Add the following to /etc/sysctl.conf:

kernel.panic = 20

This tells the kernel that if it encounters a panic, it is to reboot the system after a 20 second delay. By default, the kernel will never reboot when it encounters a panic, but with the above setting you can force it to."

沒有留言: