()
| 1640 | } |
| 1641 | |
| 1642 | fn service_run_processes() -> anyhow::Result<Vec<ServiceRunProcess>> { |
| 1643 | let output = ProcessCommand::new("ps") |
| 1644 | .args(["-axo", "pgid=,command="]) |
| 1645 | .output() |
| 1646 | .context("list SimDeck service processes")?; |
| 1647 | if !output.status.success() { |
| 1648 | return Ok(Vec::new()); |
| 1649 | } |
| 1650 | let stdout = String::from_utf8_lossy(&output.stdout); |
| 1651 | Ok(stdout |
| 1652 | .lines() |
| 1653 | .filter_map(parse_service_run_process_line) |
| 1654 | .collect()) |
| 1655 | } |
| 1656 | |
| 1657 | fn parse_service_run_process_line(line: &str) -> Option<ServiceRunProcess> { |
| 1658 | let (pgid, command) = take_ps_field(line)?; |
no test coverage detected