From 0de031c76526a44a831cfe5f6d654dfee66de93a Mon Sep 17 00:00:00 2001 From: Vladislav Grechannik Date: Sun, 8 Mar 2026 18:09:31 +0100 Subject: [PATCH] Send monotonic time to systemd after `reload` notification Co-authored-by: Andrew Hunter --- src/router/run.rs | 2 +- src/service/config/mod.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/router/run.rs b/src/router/run.rs index 50d0c2f2..0141f6ee 100644 --- a/src/router/run.rs +++ b/src/router/run.rs @@ -65,7 +65,7 @@ pub(crate) async fn start(server: Arc) -> Result> { let services = Services::build(server).await?.start().await?; #[cfg(all(feature = "systemd", target_os = "linux"))] - sd_notify::notify(true, &[sd_notify::NotifyState::Ready]) + sd_notify::notify(false, &[sd_notify::NotifyState::Ready]) .expect("failed to notify systemd of ready state"); debug!("Started"); diff --git a/src/service/config/mod.rs b/src/service/config/mod.rs index 461aec27..78153b44 100644 --- a/src/service/config/mod.rs +++ b/src/service/config/mod.rs @@ -49,13 +49,16 @@ impl Deref for Service { fn handle_reload(&self) -> Result { if self.server.config.config_reload_signal { #[cfg(all(feature = "systemd", target_os = "linux"))] - sd_notify::notify(true, &[sd_notify::NotifyState::Reloading]) - .expect("failed to notify systemd of reloading state"); + sd_notify::notify(false, &[ + sd_notify::NotifyState::Reloading, + sd_notify::NotifyState::monotonic_usec_now().expect("failed to get monotonic time"), + ]) + .expect("failed to notify systemd of reloading state"); self.reload(iter::empty())?; #[cfg(all(feature = "systemd", target_os = "linux"))] - sd_notify::notify(true, &[sd_notify::NotifyState::Ready]) + sd_notify::notify(false, &[sd_notify::NotifyState::Ready]) .expect("failed to notify systemd of ready state"); }