Yes, getting the pid from each process launch is not the problem - it's
more of a wish that I could do this automagically somehow, instead of
having to collect all the pids somewhere. But it seems as if I'll have
to do that.

Thanks
Jon

On Mon, 24 Aug 2009 13:00 -0400, "Greg Sabino Mullane"
<g...@endpoint.com> wrote:
> > But that doesn't work, because some servers, like httpd, launch in 
> > such a way that the parent httpd process ends up with ppid = 1.
> 
> Do they provide an interface to get the PID? ISTR that
> HTTP::Server::Simple does, for example. In which case...
> 
> > Is there any way to automatically kill all the child processes 
> > created by a script (and their descendents)? For example, can I
> > catch each subprocess creation somehow and record the pid in a
> > global array?
> 
> I don't know about the collection part, but I always store PIDs to local
> *.pid files, the better to be able to clean them up on subsequent runs,
> should a test get interrupted. I can also make that the main job of a
> t/99-cleanup.t file: walk through the pid dirs and kill anything still
> running, then remove any temp directories that they may have been using.
> Encapsulating that work into a single test is also nice as you can
> simply call that test as part of 'make [dist]clean' :)
> 
> -- 
> Greg Sabino Mullane g...@endpoint.com
> End Point Corporation
> PGP Key: 0x14964AC8
> 
-- 
  Jonathan Swartz
  jonswa...@fastmail.net

Reply via email to