Kill forked processes

Steve Juranich sjuranic at gmail.com
Mon Feb 27 01:07:57 EST 2006


kmkz wrote:

> Lets say my script A executes two other scripts, B and C. B is a Python
> file compiled into an exe and uses the regular black box. C, however,
> is a C++ program that I did not write, and have no access to (besides
> executing it. ie, i don't have its source). I would like to fork off
> the process B and C from A, but make B and C invisible and unable to be
> shut down by the user. This way, they have to kill process A.
> Unfortunately, this brings me back to the problem I posted above: how
> to make the subprocesses dependant on its parent process. Since I have
> no access to the C++ program's source I need to come up with a better
> way of forcing the OS to "see" process B as being inside of process C
> and then shut it down, deallocate its memory, close its pipes, etc...
> 
> Any ideas?

Again, the atexit and signal modules will be your friend.

> I'll be willing to PayPal $10 to anyone who completely figures this out
> for me :)

1) I wouldn't want to spoil the fun.
2) My time writing code costs much more than that. :-)

-- 
Steve Juranich
Tucson, AZ
USA




More information about the Python-list mailing list