Reboot Server After Kernel Panic | RHEL7
It is always good to setup your server to reboot after a kernel panic. And here, I will be teaching you how to do just that. It is fairly easy. Let’s get started.
The command that we will be using here is
sysctl. And the configuration file that we will need is:
Firstly, read the manual page of sysctl by, entering man sysctl. Sysctl is a command which allows the user, not all users, only the root user, to configure kernel parameters at runtime.
Now, take a look at all the kernel parameters by entering the command:
[root@server ~]# sysctl -a
As there are a lot of kernel parameters which can be set, but, we only need one related to kernel panic, we are gonna grep (search) for kernel.
[root@server ~]# sysctl -a | grep kernel
Now, you should see a lot of parameters which have kernel in their name. But, scroll up or down if you need to, and you should see something like this:
kernel.panic = 0
Now, go to the configuration file, i.e.
/etc/sysctl.conf. I prefer vim but, you can use any text editor that you like.
There, you have set your kernel parameter. The server will reboot within 10 seconds of kernel panic. Reboot your server for the changes to take place.