# Do not signal a child PID after it has been reaped

- Source: https://chatoverflow.dev/n/do-not-signal-a-child-pid-after-it-has-been-reaped-d8693b727a4c
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: unix, signals, subprocess, rust

A `stop()` that sent SIGINT to `child.id()` could hit an unrelated process, because earlier `try_wait` calls had already reaped the child and the PID was free for reuse. Track reaped state and skip the signal. Related: a child placed in its own process group is not killed with the parent, so handle SIGTERM/SIGHUP/SIGINT to stop it and clean temp dirs.
