cm-no-ui, debug

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-03-30 21:35:47 +08:00
parent 6238098cd0
commit f91514e164
3 changed files with 6 additions and 27 deletions

View File

@ -143,16 +143,13 @@ impl DesktopManager {
} }
fn get_supported_display_seat0_username(&self) -> Option<String> { fn get_supported_display_seat0_username(&self) -> Option<String> {
if is_gdm_user(&self.seat0_username) if is_gdm_user(&self.seat0_username) && self.seat0_display_server == DISPLAY_SERVER_WAYLAND
&& self.seat0_display_server == DISPLAY_SERVER_WAYLAND
{ {
None None
} else if self.seat0_username.is_empty() {
None
} else { } else {
if self.seat0_username.is_empty() { Some(self.seat0_username.clone())
None
} else {
Some(self.seat0_username.clone())
}
} }
} }

View File

@ -2217,13 +2217,9 @@ async fn start_ipc(
if !username.is_empty() { if !username.is_empty() {
break; break;
} }
let _res = timeout(500, _rx_desktop_ready.recv()).await; let _res = timeout(1_000, _rx_desktop_ready.recv()).await;
username = linux_desktop_manager::get_username(); username = linux_desktop_manager::get_username();
} }
println!(
"REMOVE ME =================================== headless username '{}' ",
&username
);
let uid = { let uid = {
let output = run_cmds(format!("id -u {}", &username))?; let output = run_cmds(format!("id -u {}", &username))?;
let output = output.trim(); let output = output.trim();
@ -2232,11 +2228,7 @@ async fn start_ipc(
} }
output.to_string() output.to_string()
}; };
user = Some((username, uid)); user = Some((uid, username));
println!(
"REMOVE ME =================================== headless user '{:?}' ",
&user
);
args = vec!["--cm-no-ui"]; args = vec!["--cm-no-ui"];
} }
let run_done; let run_done;
@ -2251,10 +2243,6 @@ async fn start_ipc(
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
{ {
log::debug!("Start cm"); log::debug!("Start cm");
println!(
"REMOVE ME =================================== start_ipc 222 '{}' ",
linux_desktop_manager::is_headless()
);
res = crate::platform::run_as_user(args.clone(), user.clone()); res = crate::platform::run_as_user(args.clone(), user.clone());
} }
if res.is_ok() { if res.is_ok() {
@ -2269,10 +2257,6 @@ async fn start_ipc(
} else { } else {
run_done = false; run_done = false;
} }
println!(
"REMOVE ME =================================== start_ipc 333 '{}' ",
run_done
);
if !run_done { if !run_done {
log::debug!("Start cm"); log::debug!("Start cm");
super::CHILD_PROCESS super::CHILD_PROCESS

View File

@ -450,8 +450,6 @@ fn run(sp: GenericService) -> ResultType<()> {
#[cfg(windows)] #[cfg(windows)]
ensure_close_virtual_device()?; ensure_close_virtual_device()?;
println!("REMOVE ME ================================= run 111");
// ensure_inited() is needed because release_resource() may be called. // ensure_inited() is needed because release_resource() may be called.
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
super::wayland::ensure_inited()?; super::wayland::ensure_inited()?;