saltstack/salt — pull request #800 by grierj (2012-03-01 01:43:17+00:00)
Title: Clean up multiprocessing processes on SIGTERM

First pass at cleaning up the processes spawned by the salt master
when run in the foreground via some process minder like runit or
daemontools.

This current method is a little inelegant as the cleanup code gets
pulled into the child processes themselves and you waste a few cycles
trying to clean proc objects from the children in the clean_proc() function.

That being said, it works and doesn't orphan processes. I'm open to
better ways to do it, but I didn't want to do any major surgery right
at the moment. I'm not opposed to it, I just had a pressing need, but
I can work on a more integrated solution in the future.