()
| 1720 | } |
| 1721 | |
| 1722 | fn workspace_service_processes() -> anyhow::Result<Vec<WorkspaceServiceProcess>> { |
| 1723 | let output = ProcessCommand::new("ps") |
| 1724 | .args(["-axo", "pid=,ppid=,pgid=,command="]) |
| 1725 | .output() |
| 1726 | .context("list SimDeck service processes")?; |
| 1727 | if !output.status.success() { |
| 1728 | return Ok(Vec::new()); |
| 1729 | } |
| 1730 | let stdout = String::from_utf8_lossy(&output.stdout); |
| 1731 | Ok(stdout |
| 1732 | .lines() |
| 1733 | .filter_map(parse_workspace_service_process_line) |
| 1734 | .collect()) |
| 1735 | } |
| 1736 | |
| 1737 | fn parse_workspace_service_process_line(line: &str) -> Option<WorkspaceServiceProcess> { |
| 1738 | let (pid, rest) = take_ps_field(line)?; |
no test coverage detected