in reply to Tracking child processes

You're probably gonna have to be more specific about your architecture and code and problems before anyone can help you.

I don't know what timescales you're working on, but running an occasional ps shouldn't be that much of a burden. Have you tried?

Check this out for a start: Proc::ProcessTable

andyford
or non-Perl: Andy Ford

Replies are listed 'Best First'.
Re^2: Tracking child processes
by Zubinix (Acolyte) on Sep 30, 2006 at 10:43 UTC
    Thanks for the link to Proc::ProcessTable. Its hard to be specific because I have to tackle this problem generally. Don't worry about timescale it not important. The point of the post is to find out methodologies people use to track process creation and do the tidy up at the end. For example, I kick off a script which launches multiple scripts on remote machines. These scripts in turn have many child processes which sometimes die before cleaning up thus leaving orphan processes lying around which might be holding resources such as file handles. This interferes with subsequent automation runs.

    So, what methods are there in perl for real time process tracing? Such a method would allow clean up of child processes without interfering with other processes on the machine (regardless of user). Has anyone tackled a problem like this before?