Expand description
sdwd - SystemD WatchDog crate. Provides simple watchdog notification utilities for easy watchdog management.
§Usage
fn main() {
let recommended_timeout = sdwd::recommended_timeout().unwrap();
println!("Recommended timeout: {:?}", recommended_timeout);
let _ = sdwd::start_watchdog_thread(recommended_timeout);
loop {
use std::thread;
use std::time::Duration;
thread::sleep(Duration::from_secs(5));
println!("Printing this message once in five seconds");
}
}
Functions§
- expected_
timeout - Returns expected watchdog ping timeout with microseconds precision.
- ping_
watchdog - Pings the watchdog. Should be called repeatedly within the
expected_timeout()
interval. - recommended_
timeout - According to the documentation of the systemd, it is recommended to ping watchdog every half of the
expected_timeout()
’s. - start_
watchdog_ thread - Starts watchdog thread pinging with specified interval.