here's my problem: i am spawning a child process using spawnv in c,
launching an executable and passing some arguments to it. then, in another
thread i wait for a certain amount of time and if the first thread reaches a
certain threshold, i kill the spawned child process. this works total okay
but because the executable that i run in the spawned process launches some
other programs on its own, they continue to run regardless of the fact that
i killed their parent process. to make things clear: i spawn process A.
process A is an executable and i don't have its source. process A launches
a bunch of other processes B, C and D ( they are also separate executables
w/o source code ). when i kill process A, it dies but processes B, C and D
continue to run.
so, the question is: is there a way to kill the children of a child process
( i.e. grandchildren ) without actually knowing their pids explicitly, i.e.
can i say to a process "die and kill all your children, too" *without*
modifying the code for that child process?
thanx in advance...