fix(Live2D): 用 bash kill -9 \ 替代 pkill(pkill 从 Rust 执行不生效)
This commit is contained in:
@@ -214,11 +214,10 @@ impl Plugin for VideoPlugin {
|
|||||||
let _ = child.kill();
|
let _ = child.kill();
|
||||||
let _ = child.wait();
|
let _ = child.wait();
|
||||||
}
|
}
|
||||||
// Firefox 会 fork 多个子进程,child.kill() 只杀父进程,用 pkill -9 兜底
|
// Firefox 会 fork 多个子进程,用 shell kill -9 杀整个进程树
|
||||||
let _ = std::process::Command::new("/usr/bin/pkill")
|
let _ = std::process::Command::new("/bin/bash")
|
||||||
.arg("-9")
|
.arg("-c")
|
||||||
.arg("-f")
|
.arg("kill -9 $(pgrep firefox-esr) 2>/dev/null")
|
||||||
.arg("firefox-esr")
|
|
||||||
.output();
|
.output();
|
||||||
// 启动 Firefox kiosk 模式全屏显示 Live2D
|
// 启动 Firefox kiosk 模式全屏显示 Live2D
|
||||||
let port = config.remote_control.port;
|
let port = config.remote_control.port;
|
||||||
@@ -249,11 +248,10 @@ impl Plugin for VideoPlugin {
|
|||||||
let _ = child.kill();
|
let _ = child.kill();
|
||||||
let _ = child.wait();
|
let _ = child.wait();
|
||||||
}
|
}
|
||||||
// Firefox 会 fork 多个子进程,child.kill() 只杀父进程,用 pkill -9 兜底
|
// Firefox 会 fork 多个子进程,用 shell kill -9 杀整个进程树
|
||||||
let _ = std::process::Command::new("/usr/bin/pkill")
|
let _ = std::process::Command::new("/bin/bash")
|
||||||
.arg("-9")
|
.arg("-c")
|
||||||
.arg("-f")
|
.arg("kill -9 $(pgrep firefox-esr) 2>/dev/null")
|
||||||
.arg("firefox-esr")
|
|
||||||
.output();
|
.output();
|
||||||
println!("[VideoPlugin] 切回视频模式:Firefox kiosk 已关闭");
|
println!("[VideoPlugin] 切回视频模式:Firefox kiosk 已关闭");
|
||||||
|
|
||||||
@@ -307,10 +305,9 @@ impl Plugin for VideoPlugin {
|
|||||||
let _ = child.kill();
|
let _ = child.kill();
|
||||||
let _ = child.wait();
|
let _ = child.wait();
|
||||||
}
|
}
|
||||||
let _ = std::process::Command::new("/usr/bin/pkill")
|
let _ = std::process::Command::new("/bin/bash")
|
||||||
.arg("-9")
|
.arg("-c")
|
||||||
.arg("-f")
|
.arg("kill -9 $(pgrep firefox-esr) 2>/dev/null")
|
||||||
.arg("firefox-esr")
|
|
||||||
.output();
|
.output();
|
||||||
|
|
||||||
self.publish_status();
|
self.publish_status();
|
||||||
|
|||||||
Reference in New Issue
Block a user