Not sure about the details, but I would look into "process groups".  I 
think, however, you have to explicitly define the process group to use 
these OS features.

In addition, each process knows which process started it. If you are 
running on a Unix (or variant), an "ls -ef"  (all processes, full listing) 
will show the parent process ID for each running process.  There are APIs 
that let you iterate over running processes and you can examine the parent 
PID and see if you want it.  So it is a question of reading up on the 
process handling APIs to see if, "you can get there from here."

If you want a short-hand method to kill all the processes as a group, I'd 
try the explicit grouping.  I know, from using Apache, that killing a 
parent process typically leaves the child processes alone (at least if they 
are daemons, i.e. detached from the terminal/login).

Sorry so vague.  I don't have a Unix login handy at the moment.  Hope this 
helps.

Charlie

At 05:39 AM 3/6/2002 -0800, s s wrote:
>I have a script which executes another script by using
>the system command:
>system("script1");
>
>script1 had started some processes and also spawned
>off several child processes. Is there a way in which I
>can find out from my script which processes were
>spawned by script1 when it was invoked from my script?
>It is possible that there maybe several instances of
>script1 running at the time that script1 is invoked
>from my script.
>
>Thanks.
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Try FREE Yahoo! Mail - the world's greatest free email!
>http://mail.yahoo.com/

Reply via email to