If you mean to reboot when there is a kernel panic, you can edit
/etc/default/grub and add the
panic=10 parameter which will reboot after 10 seconds of a panic. Add it to the line containing
GRUB_CMDLINE_LINUX_DEFAULT=, e.g that line should read:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash panic=10"
You can change that number to the seconds you want to initiate the reboot after the panic. To reboot immediately after a panic add a negative value, e.g.
panic=-1. After editing that file run
Alternatively you can edit
/etc/sysctl.conf and add the
kernel.panic = 10
line there. It has the same meaning.
Also if you want to reboot on oops-es too, you may add the
oops=panic kernel parameter in the
/etc/default/grub file, so the line will read something like:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash panic=10 oops=panic"
This will trigger a panic on oops-es too and reboot after 10 seconds. (Again don't forget to run
sudo update-grub after editing the grub file.