Home > linux > Configure reboot on Linux kernel panic

Configure reboot on Linux kernel panic

January 20Hits:4
Advertisement

You can put "panic=N" on the kernel command line to make the system reboot N seconds after a panic. Is there a config option to specify this (other than the default kernel command line option)?

Answers

There does not seem to be such a config option. The default timeout is 0 which according to http://www.mjmwired.net/kernel/Documentation/kernel-parameters.txt#1898 is "wait forever".

The option is defined in kernel/panic.c, you can write a patch that sets the initial value to something different.

To hardcode a reboot after 3 seconds, change:

int panic_timeout;

to:

int panic_timeout = 3;

From man proc:

/proc/sys/kernel/panic

This file gives read/write access to the kernel variable panic_timeout. If this is zero, the kernel will loop on a panic; if nonzero it indicates that the kernel should autoreboot after this number of seconds. When you use the software watchdog device driver, the recommended setting is 60.

The config file is boot (grub) configuration file itself, since it is a parameter invoked at the boot time and grub cannot be expected to read from some other config file while the filesystem is not mounted.

However, that being a initialized setting, the runtime can also be modified through sysctl. So, essentially updating /etc/sysctl.conf with parameter kernel.panic = 3 is a configuration update.

You can use this patch, which adds a config option.

first conclude information in other answers. the value is defined in kernel/panic.c and rw through sysctl. it can be passed as a boot commanline.

what's more i'm about to say, boot commandline can be set default value during compilation.

kernel.panic is a sysctl. There are many ways to configure these, for example through sysctl.d.

Related Articles

  • Configure reboot on Linux kernel panicJanuary 20

    You can put "panic=N" on the kernel command line to make the system reboot N seconds after a panic. Is there a config option to specify this (other than the default kernel command line option)? --------------Solutions------------- There does not

  • How do I detect that my system has auto-rebooted after a kernel panic?June 10

    I'm using Linux in embedded systems, and want to configure the system to automatically reboot after a kernel panic. However, when the system comes back up, it's important for me to detect and log the fact that the kernel panicked (rather than, say, t

  • Determining cause of Linux kernel panicJanuary 7

    I'm running an Ubuntu 12.04 derivative (amd64) and I've been having really strange issues recently. Out of the blue, seemingly, X will freeze completely for a while (1-3 minutes?) and then the system will reboot. This system is overclocked, but very

  • How should I capture Linux kernel panic stack traces?September 15

    What's current best practice to capture full kernel stack traces on a Linux system (RHEL 5.x, kernel 2.6.18) that occasionally panics in a device driver? I'm used to the "old" SunOS way of doing things - crash dumps get written to swap, and on r

  • How to debug Linux kernel panic?September 27

    I am trying to debug a kernel panic. Panic message says unable to handle kernel paging request for address 40025694. At the time of panic it was executing ldreq r10, [lr, #-4] @ get SWI instruction. According to my understanding link register value i

  • Linux + Kernel panicJanuary 13

    when I reboot my Linux machine Linux version 5.5 red hat I get the following warning on the console screen , Linux cant startup and I can't login please advice , how to login as single user mode and how to bypass the following problem ? umounting old

  • How to debug random reboots, with no kernel panic, of an embedded system?August 2

    I have two aValue RPC-10W1 embedded systems that reboots by themselves after 1-2 hours. Facts: The board will reboot within a time span of 1 to 2½ hours. The issue is present on two identical systems. The issue is present using aValue's own Linux fir

  • How to automate configuration of the Linux kernel buildMarch 29

    I'm compiling a flavor of the Linux kernel based on the default configuration (for an ODROID system), with some additional features enabled. I want to automate this process so that I don't have to reselect the features again if I want to build a newe

  • Second boot of Linux - Kernel PanicMarch 24

    I am currently working on a Linux distribution created with buildroot for an ARM device. The file system is JFFS2. I am booting with Das U-Boot. I am able to successfully boot exactly once. My initial boot is successful and I am able to login to linu

  • What are the ways to improve system stability and prevent data loss in conditions of frequent hard reboots and/or kernel panics?June 2

    Suppose we are working in environment where you can't be sure that your computer won't just suddenly shut off. What measures can be taken to improve system's (unix) resist to such failures? And how to ensure that risk of data loss (on hard drive) is

  • PCI configuration method error (Linux Kernel)May 25

    (I'm not sure if here is the best place for that question, so I will be pleased if anyone suggests me a more proper forum for that.) I'm trying to install Ubuntu 12.04.4 in a netbook (from an usb), but the kernel stops very early in initialization pr

  • Linux kernel crash: How to gather information?July 29

    I am developing a node.js application --- which frequently crashes my Debian Linux kernel: The computer becomes unresponsive and doesn't even respond to 'ping'. At this stage, I don't even ask to analyze or fix the cause of the crashes. I don't have

  • Kernel level IP configuration not working in Linux kernelFebruary 6

    I have enabled kernel level IP configuration in my linux kernel and compiled it, but it does not try get any DHCP address. Why? Is there something extra or special I have to do? --------------Solutions------------- Make sure: the kernel has loaded th

  • Intentional kernel panic under Linux?August 2

    Is there any way to cause a kernel panic under Linux? I've heard of echo c > /proc/sysrq-trigger but it seems to just freeze, and I'm not sure it's a kernel panic. Is there any C program I can run as root to cause a kernel panic? --------------Soluti

  • How to get a kernel panic count June 7

    Is there any way to check the number of kernel panic that happened on a system ? If not, any idea on how to do make this new functionality ? I would like to hear about an answer for most Unix-like systems :) --------------Solutions------------- If yo

  • Ubuntu server 12.04 made into squashfs (toram) and frequent start-up kernel panicsApril 17

    I've got a Ubuntu server 12.04 64-bit packed into squashfs and booting into RAM using toram option. When I reboot the machine I get a kernel panic 3 out of 5 times, sometimes multiple times in row, but then it will eventually just work. This is the e

  • Troubleshooting seemingly random G4 kernel panics and lockupsAugust 6

    Recently my 9 year old Apple G4 file server has been randomly crashing. Often it's a kernel panic, but sometimes the system just locks up. It seems almost always to happen when I'm out of my office... but even when I'm in my office, the system is in

  • Cannot turn on LG GT540 due to kernel panicMay 1

    I cannot turn on my LG GT540. When I try to turn it on it displays a message which says: Linux Kernel Panic Process swapper (pid : 1 ) What does this mean? How can I fix it?

  • Kernel Panic on ShutdownMarch 4

    For a few weeks, every time I shutdown my laptop, It immediately reboots and displays a kernel panic error. I haven't been able to cleanly shut down for some time. The machine is a 15" Retina Macbook Pro running 10.8.2 I have no peripherals attached.

  • How to configure automatic reboot after kernel panic?May 18

    Now, it's the first time I encountered a kernel panic on a system that I can only access remotely (i.e. not physical access). The kernel panic I encountered is basically the one described here, only that the kernel version was: Pid: 15483, comm: kvm

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.590 s.