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