diff --git a/realize/cli.go b/realize/cli.go index 4a64c60..7dfa5b6 100644 --- a/realize/cli.go +++ b/realize/cli.go @@ -9,7 +9,6 @@ import ( "os/signal" "path/filepath" "strings" - "syscall" "time" ) @@ -79,8 +78,8 @@ func (r *Realize) Stop() { // Start realize workflow func (r *Realize) Start() { - r.exit = make(chan os.Signal, 2) - signal.Notify(r.exit, os.Interrupt, syscall.SIGTERM) + r.exit = make(chan os.Signal, 1) + signal.Notify(r.exit, os.Interrupt) for k := range r.Schema.Projects { r.Schema.Projects[k].parent = r go r.Schema.Projects[k].Watch(r.exit) diff --git a/realize/projects.go b/realize/projects.go index 3e37a70..abb2343 100644 --- a/realize/projects.go +++ b/realize/projects.go @@ -540,9 +540,9 @@ func (p *Project) run(path string, stream chan Response, stop <-chan bool) (err var build *exec.Cmd var r Response defer func() { - if e := build.Process.Kill(); e != nil { - err = e - } + // https://github.com/golang/go/issues/5615 + // https://github.com/golang/go/issues/6720 + build.Process.Signal(os.Interrupt) }() // custom error pattern diff --git a/realize/projects_test.go b/realize/projects_test.go index c571b2b..1400a40 100644 --- a/realize/projects_test.go +++ b/realize/projects_test.go @@ -9,7 +9,6 @@ import ( "testing" "github.com/fsnotify/fsnotify" "os/signal" - "syscall" "time" ) @@ -143,7 +142,7 @@ func TestProject_Watch(t *testing.T) { parent: &r, }) r.exit = make(chan os.Signal, 2) - signal.Notify(r.exit, os.Interrupt, syscall.SIGTERM) + signal.Notify(r.exit, os.Interrupt) go func(){ time.Sleep(100) close(r.exit)