|
|
|
@ -15,8 +15,12 @@ func setupSignalHandlers(env packer.Environment) {
|
|
|
|
signal.Notify(ch, os.Interrupt)
|
|
|
|
signal.Notify(ch, os.Interrupt)
|
|
|
|
|
|
|
|
|
|
|
|
go func() {
|
|
|
|
go func() {
|
|
|
|
|
|
|
|
// First interrupt. We mostly ignore this because it allows the
|
|
|
|
|
|
|
|
// plugins time to cleanup.
|
|
|
|
<-ch
|
|
|
|
<-ch
|
|
|
|
log.Println("First interrupt. Ignoring, will let plugins handle...")
|
|
|
|
log.Println("First interrupt. Ignoring, but closing stdin...")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Second interrupt. Go down hard.
|
|
|
|
<-ch
|
|
|
|
<-ch
|
|
|
|
log.Println("Second interrupt. Exiting now.")
|
|
|
|
log.Println("Second interrupt. Exiting now.")
|
|
|
|
|
|
|
|
|
|
|
|
|