I did try using alarm, and that works great for keeping the parent process from hanging, but it does not help with keeping track of the child pids that hang, which is the main issue I have
Comment on Re^2: avoiding shell escapes with exec()
I was under the impression that the only reason you were using the fork was to help deal with the hanging issue. I take it you need to do some batch processing instead?