blob: c7b511d6f8e1acd1e646070e763a903a88108402 [file] [log] [blame]
==================================
Watchdog Formula
==================================
The Linux kernel can reset the system if serious problems are detected. This can
be implemented via special watchdog hardware, or via a slightly less reliable
software-only watchdog inside the kernel. Either way, there needs to be a daemon
that tells the kernel the system is working fine. If the daemon stops doing that,
the system is reset.
watchdog is such a daemon. It opens `/dev/watchdog`, and keeps writing to it
often enough to keep the kernel from resetting, at least once per minute. Each
write delays the reboot time another minute. After a minute of inactivity the
watchdog hardware will cause the reset. In the case of the software watchdog the
ability to reboot will depend on the state of the machines and interrupts.
This formula installs and configure watchdog daemon
Sample Pillars
==============
Single watchdog service
.. code-block:: yaml
watchdog:
server:
admin: root
enabled: true
interval: 1
log_dir: /var/log/watchdog
realtime: yes
timeout: 60
device: /dev/watchdog
Sample Pillars with kernel module
=================================
Salt Stack will automatically detect the necessary kernel module which needs to be loaded (ex. hpwdt, iTCO_wdt).
If the hardware model is not predefined in map.jinja the default watchdog driver is used: softdog
You may specify the kernel parameters if needed:
.. code-block:: yaml
watchdog:
server:
admin: root
enabled: true
interval: 1
log_dir: /var/log/watchdog
realtime: yes
timeout: 60
device: /dev/watchdog
module: softdog
......
......
linux:
system:
kernel:
module:
softdog:
option:
soft_panic: 1
INFO: extra formula [salt-formula-linux](https://gerrit.mcp.mirantis.com/salt-formulas/linux) required.
In that case, apply command should also care about linux state. For example:
.. code-block:: bash
salt "kvm0*" -l debug state.apply watchdog.server,linux.system.kernel -l debug
More Information
================
https://github.com/torvalds/linux/blob/master/Documentation/watchdog/watchdog-api.txt
Those formula also support json-schema definition with all options.
Please refer to "watchdog/schemas/\*.yaml" for more information.
To-Do
=====
Remove the part in `watchdog/server.sls` about the Ubuntu Xenial bug once it's fixed in upstream:
https://bugs.launchpad.net/ubuntu/+source/watchdog/+bug/1448924