(pid: u32)
| 13 | |
| 14 | #[cfg(unix)] |
| 15 | async fn kill_process_tree(pid: u32) { |
| 16 | let _ = tokio::process::Command::new("pkill") |
| 17 | .arg("-TERM") |
| 18 | .arg("-P") |
| 19 | .arg(pid.to_string()) |
| 20 | .status() |
| 21 | .await; |
| 22 | |
| 23 | tokio::time::sleep(std::time::Duration::from_millis(100)).await; |
| 24 | |
| 25 | let _ = tokio::process::Command::new("pkill") |
| 26 | .arg("-KILL") |
| 27 | .arg("-P") |
| 28 | .arg(pid.to_string()) |
| 29 | .status() |
| 30 | .await; |
| 31 | } |
| 32 | |
| 33 | pub struct BashTool; |
| 34 |