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 | 212 | #[cfg(feature = "dbus")] |
| 213 | 213 | dbus::DBusServers::start(&mut state, cli.session); |
| 214 | 214 | |
| 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 | + } | |
| 223 | 225 | } |
| 224 | 226 | |
| 225 | 227 | // Set up config file watcher. |