Hi,
I am using this crate for sending the notifications to systemd on behalf of another process.
Below is my code snippet that is used for sending the notification. I collect the process ID of the process to be monitored by the watchdog program and send the notification to the systemd on behalf of that process. The code runs fine, without any errors. But the notifications are not reaching the system. So, the systemd keeps restarting the service after watchdog timeout. Please help me am I doing the right thing here or not.
fn notify_systemd(pid: u32) {
let result = sd_notify::notify(true, &[NotifyState::MainPid(pid)]);
dbg!(&result);
match result {
Ok(()) => {
println!("notify pid: {}", pid);
}
Err(e) => {
println!("error: {:?}", e.to_string());
}
}
Thanks,
Pradeep
Hi,
I am using this crate for sending the
notificationstosystemdon behalf of another process.Below is my code snippet that is used for sending the notification. I collect the
process IDof the process to be monitored by thewatchdogprogram and send the notification to the systemd on behalf of that process. The code runs fine, without any errors. But the notifications are not reaching the system. So, thesystemdkeeps restarting the service afterwatchdog timeout. Please help me am I doing the right thing here or not.fn notify_systemd(pid: u32) {
Thanks,
Pradeep