Proper signal handling in monitor process

This commit is contained in:
Jakob Borg
2014-09-04 23:31:22 +02:00
parent df00a2251e
commit 33e9a88b56
4 changed files with 39 additions and 12 deletions

View File

@@ -19,6 +19,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"time"
)
@@ -54,7 +55,11 @@ func (p *syncthingProcess) start() error {
}
func (p *syncthingProcess) stop() {
p.cmd.Process.Kill()
if runtime.GOOS != "windows" {
p.cmd.Process.Signal(os.Interrupt)
} else {
p.cmd.Process.Kill()
}
p.cmd.Wait()
}