♻️ Use session proxy when stopping systemd target

This commit is contained in:
Lucy 2022-07-21 14:26:32 -04:00
parent c450a9ed0d
commit d13768607c
No known key found for this signature in database
GPG key ID: EBC517FAD666BBF1
2 changed files with 13 additions and 3 deletions

View file

@ -42,8 +42,8 @@ async fn main() -> Result<()> {
.wrap_err("failed to start systemd target")?;
// Always stop the target when the process exits or panics.
scopeguard::defer! {
if let Ok(manager) = systemd_client::manager::build_blocking_proxy() {
manager.stop_unit("cosmic-session.target", "replace").ok();
if let Err(error) = systemd::stop_systemd_target() {
error!("failed to stop systemd target: {:?}", error);
}
}
let env_vars = env_rx