diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-27 11:26:47 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-27 11:26:47 +0400 |
| commit | f0611cd502c2e3f9b3eba200251202f7497f21a8 (patch) | |
| tree | 08d0654ed4e97db1accc68e2870c11e531ab96b9 | |
| parent | b1791a7b387adee604707a532a7251c54825ce65 (diff) | |
| download | niri-f0611cd502c2e3f9b3eba200251202f7497f21a8.tar.gz niri-f0611cd502c2e3f9b3eba200251202f7497f21a8.tar.bz2 niri-f0611cd502c2e3f9b3eba200251202f7497f21a8.zip | |
Wait for import-environment to finish
| -rw-r--r-- | src/niri.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/niri.rs b/src/niri.rs index a7dbfb54..9b6e3a17 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -166,8 +166,22 @@ impl Niri { dbus-update-activation-environment WAYLAND_DISPLAY", ]) .spawn(); - if let Err(err) = rv { - warn!("error spawning shell to import environment into systemd: {err:?}"); + // Wait for the import process to complete, otherwise services will start too fast + // without environment variables available. + match rv { + Ok(mut child) => match child.wait() { + Ok(status) => { + if !status.success() { + warn!("import environment shell exited with {status}"); + } + } + Err(err) => { + warn!("error waiting for import environment shell: {err:?}"); + } + }, + Err(err) => { + warn!("error spawning shell to import environment into systemd: {err:?}"); + } } // Set up zbus, make sure it happens before anything might want it. |
