end child process when parent dies (on Unix)

Дамјан Георгиевски gdamjan at gmail.com
Sun Nov 16 23:58:29 EST 2008


Hi all,
I'm starting a Unix tool with subprocess.Popen() from a python script 
and I want the child to be killed when the parent (my script) ends for 
whatever reason *including* if it gets killed by SIGKILL.

For normal situations I can send a signal to the pid of the Popen object.
But not if the script ends abnormally (SIGKILL etc).

AFAIK there were some tricks with process leaders and stuff like that so if 
someone remembers the exact semantics of that could refresh my memory.



-- 
дамјан ( http://softver.org.mk/damjan/ )

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?



More information about the Python-list mailing list