Petr Ruzicka | ba0a49d | 2018-01-31 22:16:20 +0100 | [diff] [blame] | 1 | |
| 2 | ================================== |
| 3 | Watchdog Formula |
| 4 | ================================== |
| 5 | |
Petr Ruzicka | 802abc2 | 2018-03-19 08:49:43 +0100 | [diff] [blame] | 6 | The Linux kernel can reset the system if serious problems are detected. This can |
| 7 | be implemented via special watchdog hardware, or via a slightly less reliable |
| 8 | software-only watchdog inside the kernel. Either way, there needs to be a daemon |
| 9 | that tells the kernel the system is working fine. If the daemon stops doing that, |
| 10 | the system is reset. |
Petr Ruzicka | ba0a49d | 2018-01-31 22:16:20 +0100 | [diff] [blame] | 11 | |
Petr Ruzicka | 802abc2 | 2018-03-19 08:49:43 +0100 | [diff] [blame] | 12 | watchdog is such a daemon. It opens `/dev/watchdog`, and keeps writing to it |
| 13 | often enough to keep the kernel from resetting, at least once per minute. Each |
| 14 | write delays the reboot time another minute. After a minute of inactivity the |
| 15 | watchdog hardware will cause the reset. In the case of the software watchdog the |
| 16 | ability to reboot will depend on the state of the machines and interrupts. |
| 17 | |
| 18 | This formula installs and configure watchdog daemon... |
Petr Ruzicka | ba0a49d | 2018-01-31 22:16:20 +0100 | [diff] [blame] | 19 | |
| 20 | Sample Pillars |
| 21 | ============== |
| 22 | |
| 23 | Single watchdog service |
| 24 | |
| 25 | .. code-block:: yaml |
| 26 | |
| 27 | watchdog: |
| 28 | server: |
Petr Ruzicka | 7a333c3 | 2018-02-01 14:02:59 +0100 | [diff] [blame] | 29 | admin: root |
Petr Ruzicka | ba0a49d | 2018-01-31 22:16:20 +0100 | [diff] [blame] | 30 | enabled: true |
Petr Ruzicka | 7a333c3 | 2018-02-01 14:02:59 +0100 | [diff] [blame] | 31 | interval: 1 |
| 32 | log_dir: /var/log/watchdog |
| 33 | realtime: yes |
Petr Ruzicka | ba0a49d | 2018-01-31 22:16:20 +0100 | [diff] [blame] | 34 | timeout: 60 |
Petr Ruzicka | 7a333c3 | 2018-02-01 14:02:59 +0100 | [diff] [blame] | 35 | device: /dev/watchdog |
| 36 | |
| 37 | # Salt Stack will automatically detect the necessary kernel module which needs to be loaded (ex. hpwdt, iTCO_wdt). |
| 38 | # If the hardware model is not predefined in map.jinja the default watchdog driver is used: softdog |
| 39 | # You may specify the kernel parameters if needed: |
Petr Ruzicka | ba0a49d | 2018-01-31 22:16:20 +0100 | [diff] [blame] | 40 | kernel: |
| 41 | parameter: |
| 42 | soft_panic: 1 |
| 43 | parameter: value |
| 44 | parameter_only_without_value: none |
| 45 | |
| 46 | |
| 47 | More Information |
| 48 | ================ |
| 49 | |
| 50 | https://github.com/torvalds/linux/blob/master/Documentation/watchdog/watchdog-api.txt |
| 51 | |
| 52 | |
| 53 | Documentation and Bugs |
| 54 | ====================== |
| 55 | |
| 56 | To learn how to install and update salt-formulas, consult the documentation |
| 57 | available online at: |
| 58 | |
| 59 | http://salt-formulas.readthedocs.io/ |
| 60 | |
| 61 | In the unfortunate event that bugs are discovered, they should be reported to |
| 62 | the appropriate issue tracker. Use GitHub issue tracker for specific salt |
| 63 | formula: |
| 64 | |
| 65 | https://github.com/salt-formulas/salt-formula-watchdog/issues |
| 66 | |
| 67 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 68 | use Launchpad salt-formulas project: |
| 69 | |
| 70 | https://launchpad.net/salt-formulas |
| 71 | |
| 72 | Developers wishing to work on the salt-formulas projects should always base |
| 73 | their work on master branch and submit pull request against specific formula. |
| 74 | |
| 75 | You should also subscribe to mailing list (salt-formulas@freelists.org): |
| 76 | |
| 77 | https://www.freelists.org/list/salt-formulas |
| 78 | |
| 79 | Any questions or feedback is always welcome so feel free to join our IRC |
| 80 | channel: |
| 81 | |
| 82 | #salt-formulas @ irc.freenode.net |
Petr Ruzicka | de2a51b | 2018-03-08 13:44:59 +0100 | [diff] [blame] | 83 | |
| 84 | |
| 85 | To-Do |
| 86 | ================ |
| 87 | |
Petr Ruzicka | 802abc2 | 2018-03-19 08:49:43 +0100 | [diff] [blame] | 88 | Remove the part in `watchdog/server.sls` about the Ubuntu Xenial bug once it's fixed in upstream: |
Petr Ruzicka | de2a51b | 2018-03-08 13:44:59 +0100 | [diff] [blame] | 89 | https://bugs.launchpad.net/ubuntu/+source/watchdog/+bug/1448924 |