fc8使用的2.6.23内核的稳定性不够理想,这两天频繁crash,下载了2.6.24的新内核,准备重新编译,可是编译的时候,竟然也crash掉 了。上网查了资料,Kernel Panic会导致系统crash,并且默认的系统会一直hung在那里,直到你去把它重新启动!
What is kernel panic?
A kernel panic is a computer error from which the operating system (OS) cannot quickly or easily recover. The term applies primarily to Unix-based systems and to Mac OS X. In other systems, the equivalent of a kernel panic is known by slang terms such as blue screen of death, sad Mac or bomb. In Windows 3.x, this sort of malfunction was called a general protection fault.
A kernel panic produces a message or set of messages on the computer display. This information can be useful to technicians in diagnosing and resolving problems but it means little to the inexperienced user.
Kernel panic can be triggered by an inappropriate attempt by the operating system to access or write to memory. Sometimes kernel panic can be caused by software bugs or malware. Common hardware causes include failure or improper installation of random-access memory (RAM) chips, hard disk damage or data corruption, a defective microprocessor chip or incompatible device drivers.
how to avoid it??
If you want the server to get rebooted automatically after kernel hit by a pain error message, try adding panic=N to /etc/sysctl.conf file.
It specify kernel behavior on panic. By default, the kernel will not reboot after a panic, but this option will cause a kernel reboot after N seconds. For example following boot parameter will force to reboot Linux after 10 seconds.
Open /etc/sysctl.conf file
# vi /etc/sysctl.conf
When kernel panic’s, reboot after 10 second delay
kernel.panic = 10
Save and close the file. Alternatively, you may want to enable and use magic system request keys (SysRq).
另外一个讨厌的事情是系统hung住之后,键盘鼠标没有响应,这个可以通过设置Magic SysRq来试着解决,也是在/etc/sysctl.conf中,kernel.sysrq=1来激活Magic SysRq!
这样在挂住的时候至少还有一招可以使,按住 [ALT]+[SysRq]+[COMMAND], 这里SysRq是Print SCR键,而COMMAND按以下来解释!
b - 立即重启
e - 发送SIGTERM给init之外的系统进程
o - 关机
s - sync同步所有的文件系统
u - 试图重新挂载文件系统