[Scons-users] Cleaning up a background process

Brian Cody brian.j.cody at gmail.com
Tue Mar 21 10:29:55 EDT 2017


Hey everyone,

I have an issue that I pushed aside several months ago that I now need to
revisit.

A few build steps require a background process to be running. If anything
goes wrong during the build, that background process needs to be killed.
Also if nothing goes wrong during the build, the process must be killed on
completion. It's launched with an action now. There seems to be no
consistent way to be able to tell when all targets that would use the
process are completed. Instead, I was thinking to register with atexit on
spawning the process to hook in the cleanup function.

I get that it isn't directly supported but I'm not sure why it isn't
working. The atexit._exithandlers list looks good before sys.exit is called
in Script/Main.py, but the handlers just aren't called.

Is there a known fix for atexit when combined with SCons? Is there any
other sort of hook that I may be missing? Or a completely new suggestion?

Thank you

-Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170321/1275b3ea/attachment.html>


More information about the Scons-users mailing list