From 53d03bbb1f5001695d69f83047ead96d2079a36a Mon Sep 17 00:00:00 2001 From: strawberry Date: Fri, 10 Jan 2025 10:25:07 -0500 Subject: [PATCH] gate sd_notify to linux target_os only Signed-off-by: strawberry --- src/router/Cargo.toml | 2 +- src/router/run.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/router/Cargo.toml b/src/router/Cargo.toml index 1623590b..51e15aed 100644 --- a/src/router/Cargo.toml +++ b/src/router/Cargo.toml @@ -80,7 +80,7 @@ tower.workspace = true tower-http.workspace = true tracing.workspace = true -[target.'cfg(unix)'.dependencies] +[target.'cfg(all(unix, target_os = "linux"))'.dependencies] sd-notify.workspace = true sd-notify.optional = true diff --git a/src/router/run.rs b/src/router/run.rs index 1b4d7437..95d12559 100644 --- a/src/router/run.rs +++ b/src/router/run.rs @@ -63,7 +63,7 @@ pub(crate) async fn start(server: Arc) -> Result> { let services = Services::build(server).await?.start().await?; - #[cfg(feature = "systemd")] + #[cfg(all(feature = "systemd", target_os = "linux"))] sd_notify::notify(true, &[sd_notify::NotifyState::Ready]) .expect("failed to notify systemd of ready state"); @@ -99,7 +99,7 @@ pub(crate) async fn stop(services: Arc) -> Result<()> { ); } - #[cfg(feature = "systemd")] + #[cfg(all(feature = "systemd", target_os = "linux"))] sd_notify::notify(true, &[sd_notify::NotifyState::Stopping]) .expect("failed to notify systemd of stopping state");