forge
Explore
Log in

Don't you dare go Hollow

Add NIRI_DISABLE_SYSTEM_MANAGER_NOTIFY env

Browse files at this commit

22fee7b003b6a9b107eeb5000bd55b76287c9023Ivan MolodetskikhParent: e95d28e
Useful for UWSM I guess.
src/main.rsmodified+10 -8
@@ -212,14 +212,16 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
212212 #[cfg(feature = "dbus")]
213213 dbus::DBusServers::start(&mut state, cli.session);
214214
215- // Notify systemd we're ready.
216- if let Err(err) = sd_notify::notify(true, &[NotifyState::Ready]) {
217- warn!("error notifying systemd: {err:?}");
218- };
219-
220- // Send ready notification to the NOTIFY_FD file descriptor.
221- if let Err(err) = notify_fd() {
222- warn!("error notifying fd: {err:?}");
215+ if env::var_os("NIRI_DISABLE_SYSTEM_MANAGER_NOTIFY").map_or(true, |x| x != "1") {
216+ // Notify systemd we're ready.
217+ if let Err(err) = sd_notify::notify(true, &[NotifyState::Ready]) {
218+ warn!("error notifying systemd: {err:?}");
219+ };
220+
221+ // Send ready notification to the NOTIFY_FD file descriptor.
222+ if let Err(err) = notify_fd() {
223+ warn!("error notifying fd: {err:?}");
224+ }
223225 }
224226
225227 // Set up config file watcher.