packer/plugin: Set killed in the kill clients method

This commit is contained in:
Mitchell Hashimoto 2013-08-19 23:39:14 -07:00
parent f68e00085b
commit cfa9cef2bf
2 changed files with 3 additions and 1 deletions

View File

@ -73,6 +73,9 @@ type ClientConfig struct {
//
// This must only be called _once_.
func CleanupClients() {
// Set the killed to true so that we don't get unexpected panics
Killed = true
// Kill all the managed clients in parallel and use a WaitGroup
// to wait for them all to finish up.
var wg sync.WaitGroup

View File

@ -28,7 +28,6 @@ func setupSignalHandlers(env packer.Environment) {
// Force kill all the plugins, but mark that we're killing them
// first so that we don't get panics everywhere.
plugin.Killed = true
plugin.CleanupClients()
os.Exit(1)
}()