fix: start systemd target _after_ cosmic-comp is ready
This commit is contained in:
parent
334aebc398
commit
be418fde28
1 changed files with 12 additions and 7 deletions
19
src/main.rs
19
src/main.rs
|
|
@ -111,13 +111,9 @@ async fn start(
|
||||||
session_tx,
|
session_tx,
|
||||||
)
|
)
|
||||||
.wrap_err("failed to start compositor")?;
|
.wrap_err("failed to start compositor")?;
|
||||||
sleep(Duration::from_millis(2000)).await;
|
|
||||||
|
|
||||||
systemd::start_systemd_target().await;
|
// TODO: do we still need to sleep here if we are waiting for cosmic-comp's environment variables?
|
||||||
// Always stop the target when the process exits or panics.
|
sleep(Duration::from_millis(2000)).await;
|
||||||
scopeguard::defer! {
|
|
||||||
systemd::stop_systemd_target();
|
|
||||||
}
|
|
||||||
|
|
||||||
process_manager
|
process_manager
|
||||||
.start(Process::new().with_executable("cosmic-settings-daemon"))
|
.start(Process::new().with_executable("cosmic-settings-daemon"))
|
||||||
|
|
@ -129,7 +125,16 @@ async fn start(
|
||||||
.expect("failed to receive environmental variables")
|
.expect("failed to receive environmental variables")
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
info!("got environmental variables: {:?}", env_vars);
|
info!(
|
||||||
|
"got environmental variables from cosmic-comp: {:?}",
|
||||||
|
env_vars
|
||||||
|
);
|
||||||
|
|
||||||
|
systemd::start_systemd_target().await;
|
||||||
|
// Always stop the target when the process exits or panics.
|
||||||
|
scopeguard::defer! {
|
||||||
|
systemd::stop_systemd_target();
|
||||||
|
}
|
||||||
|
|
||||||
let (panel_notifications_fd, daemon_notifications_fd) =
|
let (panel_notifications_fd, daemon_notifications_fd) =
|
||||||
notifications::create_socket().expect("Failed to create notification socket");
|
notifications::create_socket().expect("Failed to create notification socket");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue