Control how long the kernel waits after a panic before rebooting or halting to improve recovery behavior. 27.01.2026 | reading time: 3 min A kernel panic can freeze a machine or trigger an automatic reboot; setting the kernel panic timeout decides which happens and after how many seconds, and this short guide shows how to change it and make the change persistent. Try it: change and verify Run these commands as root to view and set the timeout and then verify the value: ``` # show current value $ cat /proc/sys/kernel/panic 0 # set timeout to 10 seconds $ sudo sysctl -w kernel.panic=10 kernel.panic = 10 # verify $ cat /proc/sys/kernel/panic 10 ``` After this change the kernel will reboot 10 seconds after a panic if a panic occurs. Make it stick across boots Persist the value with sysctl configuration or the boot loader: add "kernel.panic = 10" to a file under /etc/sysctl.d/ and run "sysctl --system", or append "panic=10" to the kernel command line in GRUB and regenerate the config with update-grub or grub2-mkconfig; also review related knobs like panic_on_oops and watchdog integration before applying to production. When and where to use it Set a nonzero panic timeout on headless servers that must recover automatically; set zero to halt if manual investigation is required; test in a virtual machine because forcing panics with SysRq or test workloads will crash the system, and note that containers and some cloud images may block reboots. Relevant support tools Collect logs and analyze crashes with systemd-journald or remote logging, capture kernel dumps with kdump for post-mortem, and control runtime settings with sysctl; these tools help diagnose why a panic happened before changing reboot policies. Keep systems recoverable Small tuning of the kernel panic timeout can reduce downtime or preserve evidence for analysis; apply changes carefully, test, and incorporate them into broader recovery planning to improve resilience and maintainability; consider studying deeper and preparing for certifications like CompTIA Linux+ or LPIC-1 with intensive exam prep at bitsandbytes.academy to master these topics. Join Bits & Bytes Academy First class LINUX exam preparation. boot-process troubleshooting setup infrastructure