From e07cb9e4a33526bcfcbcdba326bc666d15e523a1 Mon Sep 17 00:00:00 2001 From: "Prabhakaran, Jaijiv" Date: Mon, 23 Jan 2017 15:18:32 -0800 Subject: [PATCH] Sending SIGINT to app so app can invoke any registered signal handlers --- refresh/runner.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/refresh/runner.go b/refresh/runner.go index 1bab777..1f027e0 100644 --- a/refresh/runner.go +++ b/refresh/runner.go @@ -7,6 +7,7 @@ import ( "os" "os/exec" "strings" + "syscall" ) func (m *Manager) runner() { @@ -17,7 +18,10 @@ func (m *Manager) runner() { // kill the previous command pid := cmd.Process.Pid m.Logger.Success("Stopping: PID %d", pid) - cmd.Process.Kill() + if err := cmd.Process.Signal(syscall.SIGINT); err != nil { + // If SIGINT fails, default to force Kill + cmd.Process.Kill() + } } cmd = exec.Command(m.FullBuildPath(), m.CommandFlags...) go func() {