mitchellh/packer — pull request #469 by kirikaza (2013-09-27 13:40:02+00:00)
Title: scripts: build.sh exits without being killed by SIGTERM

Command `make` finishes with `Terminated: 15` since the build.sh is killed by SIGTERM. I suppose it's because of this tricky trapping `trap "kill 0" SIGINT SIGTERM EXIT`. The solution is to reset the trapping `trap - SIGINT SIGTERM EXIT` at the end. We can do it safely after `waitAll` when there is no child to kill.

I reproduce it on Mac OS X 10.7.5, go 1.1, bash 3.2.48(1).