Add NIRI_DISABLE_SYSTEM_MANAGER_NOTIFY env
Browse files at this commit22fee7b003b6a9b107eeb5000bd55b76287c9023Parent: e95d28e1 changed file +10 -8
- src/main.rs +10 -8
src/main.rsmodified+10 -8
| @@ -212,14 +212,16 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { | |||
| 212 | #[cfg(feature = "dbus")] | 212 | #[cfg(feature = "dbus")] |
| 213 | dbus::DBusServers::start(&mut state, cli.session); | 213 | dbus::DBusServers::start(&mut state, cli.session); |
| 214 | 214 | ||
| 215 | - // Notify systemd we're ready. | 215 | + if env::var_os("NIRI_DISABLE_SYSTEM_MANAGER_NOTIFY").map_or(true, |x| x != "1") { |
| 216 | - if let Err(err) = sd_notify::notify(true, &[NotifyState::Ready]) { | 216 | + // Notify systemd we're ready. |
| 217 | - warn!("error notifying systemd: {err:?}"); | 217 | + if let Err(err) = sd_notify::notify(true, &[NotifyState::Ready]) { |
| 218 | - }; | 218 | + warn!("error notifying systemd: {err:?}"); |
| 219 | - | 219 | + }; |
| 220 | - // Send ready notification to the NOTIFY_FD file descriptor. | 220 | + |
| 221 | - if let Err(err) = notify_fd() { | 221 | + // Send ready notification to the NOTIFY_FD file descriptor. |
| 222 | - warn!("error notifying fd: {err:?}"); | 222 | + if let Err(err) = notify_fd() { |
| 223 | + warn!("error notifying fd: {err:?}"); | ||
| 224 | + } | ||
| 223 | } | 225 | } |
| 224 | 226 | ||
| 225 | // Set up config file watcher. | 227 | // Set up config file watcher. |