Safe killing of a child process
Safe killing of a child process
Posted Oct 8, 2011 12:10 UTC (Sat) by pjm (guest, #2080)In reply to: PID by Richard_J_Neill
Parent article: A Plumber's Wish List for Linux
Increasing the pid maximum number won't remove the danger, it would only make the bug rarer.
What you want is kill %process2, or have a look at bash's job control documentation.
If job control stuff won't do what you're looking for, then you can add a trap on SIGCHLD and keep track of liveness yourself. The jobs and wait builtins might be useful in some cases.
All of the above should work on any Free Unix kernel, including Linux-2.6.xx and earlier; it doesn't require adding any Linux-3.x-specific features.
