15 releases (5 stable)
Uses new Rust 2024
| new 8.0.0 | Mar 28, 2026 |
|---|---|
| 7.3.0 | Mar 6, 2026 |
| 0.6.0 | Jan 22, 2026 |
| 0.5.0 | Dec 21, 2025 |
| 0.2.0 | Dec 11, 2025 |
#353 in Development tools
85 downloads per month
Used in 2 crates
18KB
243 lines
Ensure child processes die when their parent dies.
Child processes normally continue running even after their parent exits (on Unix they get reparented to init/PID 1). This crate provides mechanisms to ensure child processes are terminated when their parent dies, even if the parent is killed with SIGKILL.
Platform Support
- Linux: Uses
prctl(PR_SET_PDEATHSIG, SIGKILL)- the child receives SIGKILL when its parent thread dies - macOS: Uses a pipe-based approach - the child monitors a pipe from the parent and exits when the pipe closes (indicating parent death)
- Windows: Uses job objects with
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE- all processes in the job are terminated when the last handle closes
Usage
For the child process (call early in main):
ur_taking_me_with_you::die_with_parent();
For spawning children with std::process::Command:
use std::process::Command;
let mut cmd = Command::new("my-plugin");
cmd.arg("--foo");
let child = ur_taking_me_with_you::spawn_dying_with_parent(cmd)
.expect("failed to spawn");
ur-taking-me-with-you
Utility crate for ensuring child processes terminate when their parent exits.
Role in the Vox stack
ur-taking-me-with-you is an operational helper used by process-launch workflows around Vox components and test tooling.
What this crate provides
- Parent-death wiring for child processes across supported platforms
- Sync and optional tokio-based process helpers
Fits with
- Runtime/test harness process orchestration where process lifetimes must stay coupled
Part of the Vox workspace: https://github.com/bearcove/vox
Dependencies
~0–3.5MB
~65K SLoC