In the event that Linux has a rare turn and decides to crash on you, you might want the machine to reboot if at all possible. The following will give you that ability. It should probably be paired with dumping any crash info out to a network server (hence the long pause – 300 secs), but very useful in any event for remote webservers.

Add the following entries to your sysctl.conf…

# vi /etc/sysctl.conf

kernel.panic_on_oops = 1
kernel.panic = 300

Then run these commands as root to enable these changes without needing to reboot:
# sysctl -w kernel.panic_on_oops=1
# sysctl -w kernel.panic=300

Categories: LAMP

Jonathan Adjei

Jon's expertise in web development is legendary and he oversees all technical aspects of our projects from development to hosting (all through the command line!) Jon is excited by the latest techniques and keeps the company on track by finding ways to adopt new practices into our workflow.