Skip to content

Panic Reboots

Calin Crisan edited this page Feb 13, 2021 · 8 revisions

Panic Action Triggers

Panic reboots are abnormal system reboots caused by various services that are malfunctioning. These services are usually started via init scripts in /etc/init.d.

An init script may trigger the panic action (that defaults to rebooting the system) at startup, when it considers that the underlying service failed to start but it was mandatory for a good functioning of the system.

Init scripts may also monitor their services using a background watch subprocess; the monitoring subprocess may decide that the underlying service ceased to work correctly and thus triggers the panic action.

Panic Sources

When calling the panic action, each service should specify a panic source as argument. Panic sources are usually (close to) the script names; for example, the /etc/init.d/S40network script, when fails, will call the panic action with source set to network.

Panic Action Implementation

The panic action function can be found in /etc/init.d/panic and is included in all init scripts.

Regardless of the panic source, the default implementation will simply reboot the system. It will however make sure the system isn't rebooted too often to prevent killing the SD card or the flash memory. This is achieved by gradually increasing the reboot delay until reaching 1 hour.

To inhibit panic reboots, just create an empty file at /var/run/panic_inhibited. This will temporarily prevent reboots due to panic actions, until the next boot.

Clone this wiki locally