Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:hardware:watchdog [2020/09/21 09:39] – [USB watchdogs] code optimized vgaetera | docs:guide-user:hardware:watchdog [2021/11/01 11:39] – [USB watchdogs] vgaetera | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| For x86 hardware you have some kmods to choose: | For x86 hardware you have some kmods to choose: | ||
| - | * '' | + | * AMD: [[packages: |
| - | * '' | + | * Intel: [[packages: |
| - | * '' | + | * Generic: [[packages: |
| There are also USB-based watchdogs, which will be discussed below in their own sub-section because they are not handled by procd in any way. | There are also USB-based watchdogs, which will be discussed below in their own sub-section because they are not handled by procd in any way. | ||
| The procd watchdog code always uses the primary watchdog device ''/ | The procd watchdog code always uses the primary watchdog device ''/ | ||
| - | You can configure what watchdog that is (ie GSC Watchdog or SoC watchdog) by disabling all but the desired watchdog in the kernel configuration, | + | You can configure what watchdog that is (i.e. GSC Watchdog or SoC watchdog) by disabling all but the desired watchdog in the kernel configuration, |
| ===== Controlling the watchdog ===== | ===== Controlling the watchdog ===== | ||
| You can see the current configuration of the watchdog service via ubus: | You can see the current configuration of the watchdog service via ubus: | ||
| - | |||
| - | If there is a watchdog available: | ||
| <code bash> | <code bash> | ||
| Line 30: | Line 28: | ||
| </ | </ | ||
| - | If no watchdog is available: | + | If no watchdog is available, the status |
| - | + | ||
| - | <code bash> | + | |
| - | # ubus call system watchdog | + | |
| - | { | + | |
| - | "status": "offline", | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| - | </ | + | |
| While there is no UCI configuration available for these options, you can change them in an rc script such as ''/ | While there is no UCI configuration available for these options, you can change them in an rc script such as ''/ | ||
| Line 45: | Line 34: | ||
| <code bash> | <code bash> | ||
| # Change timeout to 60s | # Change timeout to 60s | ||
| - | ubus call system watchdog '{ " | + | ubus call system watchdog ' |
| # Change frequency to 1s | # Change frequency to 1s | ||
| - | ubus call system watchdog '{ " | + | ubus call system watchdog ' |
| </ | </ | ||
| - | To stop the service: | + | To bypass procd, enable the magicclose feature, |
| <code bash> | <code bash> | ||
| - | ubus call system watchdog '{ " | + | ubus call system watchdog ' |
| + | ubus call system watchdog ' | ||
| + | while :; do echo 1 > / | ||
| </ | </ | ||
| Note that watchdog will cause a reset after it expires. | Note that watchdog will cause a reset after it expires. | ||
| - | |||
| - | ===== Manually control hardware watchdog ===== | ||
| - | If you just stop procd from tickling the hardware watchdog you still can't manually tickle watchdog: | ||
| - | |||
| - | <code bash> | ||
| - | # ubus call system watchdog ' | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | |||
| - | # echo 1 > / | ||
| - | -ash: can't create / | ||
| - | </ | ||
| - | |||
| - | But if you enable magicclose feature then you have control: | ||
| - | |||
| - | <code bash> | ||
| - | # ubus call system watchdog ' | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | |||
| - | # ubus call system watchdog ' | ||
| - | { | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| - | |||
| - | # echo 1 > / | ||
| - | # | ||
| - | </ | ||
| ===== USB watchdogs ===== | ===== USB watchdogs ===== | ||
| Line 112: | Line 65: | ||
| This is a script that will generate a procd service to control one of such USB-serial watchdogs. | This is a script that will generate a procd service to control one of such USB-serial watchdogs. | ||
| - | <code bash usb_watchdog> | + | <code bash> |
| + | cat << " | ||
| #!/bin/sh | #!/bin/sh | ||
| Line 159: | Line 113: | ||
| (install) | (install) | ||
| - | cat << "EOF" > / | + | cat << "EOI" > / |
| #!/bin/sh / | #!/bin/sh / | ||
| Line 174: | Line 128: | ||
| } | } | ||
| - | stop_service() | + | stop_service() { |
| - | { | + | |
| / | / | ||
| } | } | ||
| - | EOF | + | EOI |
| - | cat << "EOF" > / | + | cat << "EOI" > / |
| - | /etc/ | + | |
| / | / | ||
| /etc/rc.d/ | /etc/rc.d/ | ||
| - | EOF | + | / |
| + | EOI | ||
| chmod +x / | chmod +x / | ||
| / | / | ||
| / | / | ||
| - | |||
| - | if grep -q -e " | ||
| - | then sed -i -e "/ | ||
| - | fi | ||
| ;; | ;; | ||
| (remove) | (remove) | ||
| - | rm /lib/upgrade/keep.d/ | + | /etc/init.d/ |
| - | rm / | + | /etc/init.d/ |
| - | rm / | + | rm -f / |
| - | sed -i -e "/^\/etc\/init\.d\/ | + | rm -f / |
| + | rm -f /lib/upgrade/keep.d/ | ||
| ;; | ;; | ||
| esac | esac | ||
| + | EOF | ||
| + | chmod +x / | ||
| + | / | ||
| </ | </ | ||
| Line 208: | Line 161: | ||
| <code bash> | <code bash> | ||
| - | wget --no-check-certificate -O / | + | uclient-fetch -O usb-watchdog.sh |
| - | chmod +x /etc/ | + | . ./usb-watchdog.sh |
| - | / | + | |
| </ | </ | ||