fix: xdg autostart was not executing
This commit is contained in:
parent
e9858d914c
commit
1ef6af14bb
1 changed files with 40 additions and 45 deletions
85
src/main.rs
85
src/main.rs
|
|
@ -420,51 +420,6 @@ async fn start(
|
|||
.await;
|
||||
}
|
||||
|
||||
let mut signals = Signals::new(vec![libc::SIGTERM, libc::SIGINT]).unwrap();
|
||||
let mut status = Status::Exited;
|
||||
loop {
|
||||
let session_dbus_rx_next = session_rx.recv();
|
||||
tokio::select! {
|
||||
res = session_dbus_rx_next => {
|
||||
match res {
|
||||
Some(service::SessionRequest::Exit) => {
|
||||
info!("EXITING: session exited by request");
|
||||
break;
|
||||
}
|
||||
Some(service::SessionRequest::Restart) => {
|
||||
info!("RESTARTING: session restarted by request");
|
||||
status = Status::Restarted;
|
||||
break;
|
||||
}
|
||||
None => {
|
||||
warn!("exit channel dropped session");
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
signal = signals.next() => match signal {
|
||||
Some(libc::SIGTERM | libc::SIGINT) => {
|
||||
info!("EXITING: received request to terminate");
|
||||
break;
|
||||
}
|
||||
Some(signal) => unreachable!("EXITING: received unhandled signal {}", signal),
|
||||
None => break,
|
||||
}
|
||||
}
|
||||
}
|
||||
compositor_handle.abort();
|
||||
token.cancel();
|
||||
if let Err(err) = process_manager.stop_process(settings_daemon).await {
|
||||
tracing::error!("Failed to gracefully stop settings daemon. {err:?}");
|
||||
} else {
|
||||
match tokio::time::timeout(Duration::from_secs(1), settings_exit_rx).await {
|
||||
Ok(Ok(_)) => {}
|
||||
_ => {
|
||||
tracing::error!("Failed to gracefully stop settings daemon.");
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
#[cfg(feature = "autostart")]
|
||||
if !*is_systemd_used() {
|
||||
info!("looking for autostart folders");
|
||||
|
|
@ -571,6 +526,46 @@ async fn start(
|
|||
info!("started {} programs", dedupe.len());
|
||||
}
|
||||
|
||||
let mut signals = Signals::new(vec![libc::SIGTERM, libc::SIGINT]).unwrap();
|
||||
let mut status = Status::Exited;
|
||||
let session_dbus_rx_next = session_rx.recv();
|
||||
tokio::select! {
|
||||
res = session_dbus_rx_next => {
|
||||
match res {
|
||||
Some(service::SessionRequest::Exit) => {
|
||||
info!("EXITING: session exited by request");
|
||||
}
|
||||
Some(service::SessionRequest::Restart) => {
|
||||
info!("RESTARTING: session restarted by request");
|
||||
status = Status::Restarted;
|
||||
}
|
||||
None => {
|
||||
warn!("exit channel dropped session");
|
||||
}
|
||||
}
|
||||
},
|
||||
signal = signals.next() => match signal {
|
||||
Some(libc::SIGTERM | libc::SIGINT) => {
|
||||
info!("EXITING: received request to terminate");
|
||||
}
|
||||
Some(signal) => unreachable!("EXITING: received unhandled signal {}", signal),
|
||||
None => {},
|
||||
}
|
||||
}
|
||||
|
||||
compositor_handle.abort();
|
||||
token.cancel();
|
||||
if let Err(err) = process_manager.stop_process(settings_daemon).await {
|
||||
tracing::error!(?err, "Failed to gracefully stop settings daemon.");
|
||||
} else {
|
||||
match tokio::time::timeout(Duration::from_secs(1), settings_exit_rx).await {
|
||||
Ok(Ok(_)) => {}
|
||||
_ => {
|
||||
tracing::error!("Settings daemon process did not respond to the request to stop.");
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
tokio::time::sleep(std::time::Duration::from_secs(2)).await;
|
||||
Ok(status)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue