Proper signal handling in monitor process
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user