Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sudomesh/watchpuppy
A watchdog utility that let's you activate, configure and deactivate a hardware watchdog
https://github.com/sudomesh/watchpuppy
Last synced: 26 days ago
JSON representation
A watchdog utility that let's you activate, configure and deactivate a hardware watchdog
- Host: GitHub
- URL: https://github.com/sudomesh/watchpuppy
- Owner: sudomesh
- Created: 2015-11-11T07:53:14.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-06T07:31:40.000Z (almost 9 years ago)
- Last Synced: 2024-04-14T15:12:46.222Z (8 months ago)
- Language: C
- Size: 7.81 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a utility to activate, configure and deactivate hardware watchdogs on e.g. ar91xx chipsets. This only works on watchdogs supporting the ["Magic Close" feature](https://www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt)
Instead of having the entire watchdog daemon written in C this utility let's you write your watchdog daemon as e.g. a shell or lua script and then simply call watchpuppy at the beginning of the script to initialize the watchdog.
This program has been tested on an Atheros AR9344 on OpenWRT Chaos Calmer.
# Usage
```
watchpuppy start|stop|pat
-d device : Device file to open (default: /dev/watchdog)
-t timeout: Reboot after this many seconds with no pat (default: 30)
-b : Report whether last reboot was triggered by watchdog, then exit.
```The pat argument resets the watchdog reboot counter. You can also pat the watchdog by simply writing to the watchdog device like so:
```
echo "p" > /dev/watchdog
```Just don't write a V character as that will deactivate the watchdog.
# How to write a daemon
See example.sh for the basic structure of a watchdog script that uses watchpuppy.
# Gotchas
Be aware that you cannot, as of January 5th 2016, use this with stable OpenWRT (Chaos Calmer) without modifying procd, since there is no way to get procd to release /dev/watchdog but you can find a modified procd [here](https://github.com/sudomesh/procd/commit/d78b04cd168b9dc9e9580f6644fff692fe5a748d).
To get the modified procd to release /dev/watchdog simply run:
```
ubus call system watchdog '{ "stop": true }'
```# License and Copyright
Copyright 2015, 2016 Marc Juul
License: GPLv3