This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
products:sbc:common:applications:watchdog [2022/07/05 02:59] frank fixup syntax error |
products:sbc:common:applications:watchdog [2022/12/05 01:43] (current) nick |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== Introduction ===== | ===== Introduction ===== | ||
| - | This document mainly | + | This page introduces |
| - | ===== Enable Watchdog ===== | + | ===== Enable |
| Watchdog is disabled by default, use the commands below to enable it. | Watchdog is disabled by default, use the commands below to enable it. | ||
| <tabbox Ubuntu 18.04> | <tabbox Ubuntu 18.04> | ||
| - | ```sh | + | ```shell |
| - | khadas@Khadas: | + | sudo ln -s / |
| - | khadas@Khadas: | + | sudo systemctl enable watchdog.service |
| - | khadas@Khadas: | + | sudo systemctl start watchdog.service |
| ``` | ``` | ||
| Line 21: | Line 21: | ||
| <tabbox Ubuntu 20.04> | <tabbox Ubuntu 20.04> | ||
| - | + | ```shell | |
| - | khadas@Khadas: | + | sudo systemctl enable watchdog.service |
| - | khadas@Khadas: | + | sudo systemctl start watchdog.service |
| + | ``` | ||
| </ | </ | ||
| Check watchdog status: | Check watchdog status: | ||
| - | ```sh | + | ```shell |
| khadas@Khadas: | khadas@Khadas: | ||
| ● watchdog.service - watchdog daemon | ● watchdog.service - watchdog daemon | ||
| Line 54: | Line 54: | ||
| lines 1-21/21 (END) | lines 1-21/21 (END) | ||
| ``` | ``` | ||
| - | ===== Test Watchdog ===== | + | ===== Test Internal |
| ==== Set Watchdog Timeout ==== | ==== Set Watchdog Timeout ==== | ||
| Line 62: | Line 62: | ||
| Restart the watchdog service to take effect. | Restart the watchdog service to take effect. | ||
| - | ```sh | + | ```shell |
| - | $ sudo systemctl restart watchdog | + | sudo systemctl restart watchdog |
| ``` | ``` | ||
| Line 70: | Line 70: | ||
| Trigger a Kernel crash. | Trigger a Kernel crash. | ||
| - | ```sh | + | ```shell |
| - | khadas@Khadas: | + | echo 0 | sudo tee / |
| - | root@Khadas: | + | echo c | sudo tee / |
| ``` | ``` | ||
| Line 79: | Line 79: | ||
| You can also kill the watchdog daemon to prevent an automatic restart after a Kernel crash. | You can also kill the watchdog daemon to prevent an automatic restart after a Kernel crash. | ||
| - | ```sh | + | ```shell |
| - | khadas@Khadas: | + | $ sudo pkill -9 watchdog |
| - | khadas@Khadas: | + | $ sudo pkill -9 wd_keepalive |
| - | khadas@Khadas: | + | $ |
| - | khadas@Khadas: | + | $ |
| - | khadas@Khadas: | + | $ G12B: |
| bl2_stage_init 0x01 | bl2_stage_init 0x01 | ||
| bl2_stage_init 0x81 | bl2_stage_init 0x81 | ||
| Line 106: | Line 106: | ||
| If watchdog was setup successfully, | If watchdog was setup successfully, | ||
| - | ===== Disable Watchdog ===== | + | ===== Disable |
| Disable the Watchdog daemon. | Disable the Watchdog daemon. | ||
| - | ```sh | + | ```shell |
| - | khadas@Khadas: | + | sudo systemctl disable watchdog |
| - | khadas@Khadas: | + | sudo reboot |
| ``` | ``` | ||