virtual display, linux, debug

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-03-29 18:31:42 +08:00
parent b82207f20b
commit bcf08ba26d
3 changed files with 4 additions and 36 deletions

View File

@ -227,7 +227,7 @@ fn stop_rustdesk_servers() {
#[inline] #[inline]
fn stop_xorg_subprocess() { fn stop_xorg_subprocess() {
let _ = run_cmds(format!( let _ = run_cmds(&format!(
r##"ps -ef | grep '/etc/rustdesk/xorg.conf' | grep -v grep | awk '{{printf("kill -9 %d\n", $2)}}' | bash"##, r##"ps -ef | grep '/etc/rustdesk/xorg.conf' | grep -v grep | awk '{{printf("kill -9 %d\n", $2)}}' | bash"##,
)); ));
} }

View File

@ -111,7 +111,6 @@ impl DesktopManager {
pub fn new() -> Self { pub fn new() -> Self {
let mut x11_username = "".to_owned(); let mut x11_username = "".to_owned();
let seat0_values = get_values_of_seat0(&[0, 1, 2]); let seat0_values = get_values_of_seat0(&[0, 1, 2]);
println!("REMOVE ME ======================== DesktopManager seato values {:?}", &seat0_values);
if !seat0_values[0].is_empty() { if !seat0_values[0].is_empty() {
if "x11" == get_display_server_of_session(&seat0_values[1]) { if "x11" == get_display_server_of_session(&seat0_values[1]) {
x11_username = seat0_values[2].clone(); x11_username = seat0_values[2].clone();
@ -427,10 +426,6 @@ impl DesktopManager {
fn try_wait_x11_child_exit(child_xorg: &mut Child, child_wm: &mut Child) -> bool { fn try_wait_x11_child_exit(child_xorg: &mut Child, child_wm: &mut Child) -> bool {
match child_xorg.try_wait() { match child_xorg.try_wait() {
Ok(Some(status)) => { Ok(Some(status)) => {
println!(
"=============================MYDEBUG Xorg exit with {}",
status
);
log::info!("Xorg exit with {}", status); log::info!("Xorg exit with {}", status);
return true; return true;
} }
@ -440,10 +435,7 @@ impl DesktopManager {
match child_wm.try_wait() { match child_wm.try_wait() {
Ok(Some(status)) => { Ok(Some(status)) => {
println!( // Logout may result "wm exit with signal: 11 (SIGSEGV) (core dumped)"
"=============================MYDEBUG: wm exit with {}",
status
);
log::info!("wm exit with {}", status); log::info!("wm exit with {}", status);
return true; return true;
} }
@ -460,20 +452,12 @@ impl DesktopManager {
for _ in 0..2 { for _ in 0..2 {
match child_xorg.try_wait() { match child_xorg.try_wait() {
Ok(Some(status)) => { Ok(Some(status)) => {
println!(
"=============================MYDEBUG Xorg exit with {}",
status
);
log::info!("Xorg exit with {}", status); log::info!("Xorg exit with {}", status);
exited = true; exited = true;
break; break;
} }
Ok(None) => {} Ok(None) => {}
Err(e) => { Err(e) => {
println!(
"=============================MYDEBUG Failed to wait xorg process, {}",
&e
);
log::error!("Failed to wait xorg process, {}", e); log::error!("Failed to wait xorg process, {}", e);
Self::fatal_exit(); Self::fatal_exit();
} }
@ -481,9 +465,6 @@ impl DesktopManager {
std::thread::sleep(std::time::Duration::from_millis(1_000)); std::thread::sleep(std::time::Duration::from_millis(1_000));
} }
if !exited { if !exited {
println!(
"=============================MYDEBUG Failed to wait child xorg, after kill()"
);
log::error!("Failed to wait child xorg, after kill()"); log::error!("Failed to wait child xorg, after kill()");
// try kill -9? // try kill -9?
} }
@ -494,19 +475,12 @@ impl DesktopManager {
for _ in 0..2 { for _ in 0..2 {
match child_wm.try_wait() { match child_wm.try_wait() {
Ok(Some(status)) => { Ok(Some(status)) => {
println!( // Logout may result "wm exit with signal: 11 (SIGSEGV) (core dumped)"
"=============================MYDEBUG wm exit with {}",
status
);
log::info!("wm exit with {}", status); log::info!("wm exit with {}", status);
exited = true; exited = true;
} }
Ok(None) => {} Ok(None) => {}
Err(e) => { Err(e) => {
println!(
"=============================MYDEBUG Failed to wait wm process, {}",
&e
);
log::error!("Failed to wait wm process, {}", e); log::error!("Failed to wait wm process, {}", e);
Self::fatal_exit(); Self::fatal_exit();
} }
@ -514,9 +488,6 @@ impl DesktopManager {
std::thread::sleep(std::time::Duration::from_millis(1_000)); std::thread::sleep(std::time::Duration::from_millis(1_000));
} }
if !exited { if !exited {
println!(
"=============================MYDEBUG Failed to wait child xorg, after kill()"
);
log::error!("Failed to wait child xorg, after kill()"); log::error!("Failed to wait child xorg, after kill()");
// try kill -9? // try kill -9?
} }
@ -533,7 +504,7 @@ impl DesktopManager {
exited = Self::try_wait_x11_child_exit(child_xorg, child_wm); exited = Self::try_wait_x11_child_exit(child_xorg, child_wm);
} }
if exited { if exited {
println!("=============================MYDEBUG begin to wait x11 children exit"); log::debug!("Wait x11 children exiting");
Self::wait_x11_children_exit(child_xorg, child_wm); Self::wait_x11_children_exit(child_xorg, child_wm);
desktop_manager desktop_manager
.is_child_running .is_child_running

View File

@ -1075,7 +1075,6 @@ impl Connection {
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
if _username.is_empty() { if _username.is_empty() {
let username = crate::platform::linux_desktop_manager::get_username(); let username = crate::platform::linux_desktop_manager::get_username();
println!("REMOVE ME ===================================== try_start_desktop username '{}'", &username);
if username.is_empty() { if username.is_empty() {
LOGIN_MSG_XSESSION_NOT_READY LOGIN_MSG_XSESSION_NOT_READY
} else { } else {
@ -1315,14 +1314,12 @@ impl Connection {
} }
} else { } else {
if desktop_err.is_empty() { if desktop_err.is_empty() {
println!("REMOVE ME =============================== send logon response");
self.send_logon_response().await; self.send_logon_response().await;
self.try_start_cm(lr.my_id, lr.my_name, true); self.try_start_cm(lr.my_id, lr.my_name, true);
if self.port_forward_socket.is_some() { if self.port_forward_socket.is_some() {
return false; return false;
} }
} else { } else {
println!("REMOVE ME =============================== send login error {}", &desktop_err);
self.send_login_error(desktop_err).await; self.send_login_error(desktop_err).await;
} }
} }