From 045f2f41bd3e2f5e616dcb76140f9a920478a83e Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Fri, 22 Mar 2019 14:25:06 +0100 Subject: [PATCH] display received signal in debug mode --- command/build.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command/build.go b/command/build.go index 65dbe5de3..87331c3ae 100644 --- a/command/build.go +++ b/command/build.go @@ -159,12 +159,12 @@ func (c *BuildCommand) Run(args []string) int { signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM) defer signal.Stop(sigCh) go func(b packer.Build) { - <-sigCh + sig := <-sigCh interruptWg.Add(1) defer interruptWg.Done() interrupted = true - log.Printf("Stopping build: %s", b.Name()) + log.Printf("Stopping build: %s after receiving %s", b.Name(), sig) b.Cancel() //cancelCtx() log.Printf("Build cancelled: %s", b.Name())