diff --git a/.goxc.json b/.goxc.json index 9bb2e7d..f6ee00c 100644 --- a/.goxc.json +++ b/.goxc.json @@ -3,7 +3,7 @@ "default", "publish-github" ], - "PackageVersion": "0.0.1", + "PackageVersion": "0.0.2", "TaskSettings": { "publish-github": { "owner": "reddec", @@ -11,4 +11,4 @@ } }, "ConfigVersion": "0.9" -} +} \ No newline at end of file diff --git a/main.go b/main.go index 2e82e9c..2b4f5c0 100644 --- a/main.go +++ b/main.go @@ -232,7 +232,7 @@ main() { ctx, stp := context.WithCancel(context.Background()) c := make(chan os.Signal, 3) - signal.Notify(c, os.Interrupt, os.Kill, syscall.SIGHUP) + signal.Notify(c, os.Interrupt, syscall.SIGTERM) go func() { for range c { stp() diff --git a/monexec/executable.go b/monexec/executable.go index 7a90742..7d77cb3 100644 --- a/monexec/executable.go +++ b/monexec/executable.go @@ -83,8 +83,8 @@ func (b *Executable) Env(arg, value string) *Executable { // SIGTERM is used func (exe *Executable) stopOrKill(logger *log.Logger, cmd *exec.Cmd) { ch := make(chan struct{}, 1) - logger.Println("Sending SIGKILL") - cmd.Process.Kill() + logger.Println("Sending SIGKTERM") + cmd.Process.Signal(syscall.SIGTERM) go func() { cmd.Wait() ch <- struct{}{} @@ -95,7 +95,7 @@ func (exe *Executable) stopOrKill(logger *log.Logger, cmd *exec.Cmd) { logger.Println("Process gracefull stopped") case <-time.After(exe.StopTimeout): logger.Println("Process gracefull shutdown waiting timeout") - cmd.Process.Signal(syscall.SIGTERM) + cmd.Process.Signal(syscall.SIGKILL) } }