Hi List!

Maybe it is more a question about python, but here it goes...

I have an application in Zope which spawns a process (1) in
background, a python program by the way. I monitor the process (1) via
the PID returned.

Embedded in (1), it uses os.system to run an application (2) which
does the real job. (2) is a bash script with several embedded

However, sometimes I need to kill (1) (os.kill), and I hopped when
killing (1), (2) and any of its children should be killed as well. But
it does not happen; system (PID 1) inherit (2).

I know if I were able to keep a list of any children and grandchildren
process I could kill all of them smoothly, however for such a list I
have no idea of doing it but:
a)- doing a program to track them via unix command 'ps' output (maybe
not reliable);
b)- changing the code of the 3rd party programs (not really a good idea at all).

All interaction are done via portal made in Zope.

So, if someone could give any idea of how tackle with this problem,
mainly avoiding a) and b), I would appreciate a lot.

To simplify, I would like to know if python is able to kill a process
and its 'family' without much hassle, and if so, how?

Many thanks in advance.


Alan Wilter S. da Silva, D.Sc. - Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to