From 22fee7b003b6a9b107eeb5000bd55b76287c9023 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Fri, 13 Sep 2024 15:45:30 +0300 Subject: Add NIRI_DISABLE_SYSTEM_MANAGER_NOTIFY env Useful for UWSM I guess. --- src/main.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4345e81c..d0de54a8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -212,14 +212,16 @@ fn main() -> Result<(), Box> { #[cfg(feature = "dbus")] dbus::DBusServers::start(&mut state, cli.session); - // Notify systemd we're ready. - if let Err(err) = sd_notify::notify(true, &[NotifyState::Ready]) { - warn!("error notifying systemd: {err:?}"); - }; - - // Send ready notification to the NOTIFY_FD file descriptor. - if let Err(err) = notify_fd() { - warn!("error notifying fd: {err:?}"); + if env::var_os("NIRI_DISABLE_SYSTEM_MANAGER_NOTIFY").map_or(true, |x| x != "1") { + // Notify systemd we're ready. + if let Err(err) = sd_notify::notify(true, &[NotifyState::Ready]) { + warn!("error notifying systemd: {err:?}"); + }; + + // Send ready notification to the NOTIFY_FD file descriptor. + if let Err(err) = notify_fd() { + warn!("error notifying fd: {err:?}"); + } } // Set up config file watcher. -- cgit