A heuristic check that we were invoked with --pid=host
()
| 1443 | |
| 1444 | /// A heuristic check that we were invoked with --pid=host |
| 1445 | fn require_host_pidns() -> Result<()> { |
| 1446 | if rustix::process::getpid().is_init() { |
| 1447 | anyhow::bail!("This command must be run with the podman --pid=host flag") |
| 1448 | } |
| 1449 | tracing::trace!("OK: we're not pid 1"); |
| 1450 | Ok(()) |
| 1451 | } |
| 1452 | |
| 1453 | /// Verify that we can access /proc/1, which will catch rootless podman (with --pid=host) |
| 1454 | /// for example. |