Merge pull request #29 from hashicorp/b-sigterm

Change SIGINT to SIGTERM
This commit is contained in:
Chris Bednarski 2015-09-09 17:07:57 -07:00
commit 00d8de4ecf
2 changed files with 6 additions and 2 deletions

View file

@ -9,6 +9,8 @@ import (
"strings"
"time"
"golang.org/x/sys/unix"
"github.com/hashicorp/nomad/client/config"
"github.com/hashicorp/nomad/nomad/structs"
)
@ -113,7 +115,7 @@ func (h *execHandle) Update(task *structs.Task) error {
// Kill is used to terminate the task. We send an Interrupt
// and then provide a 5 second grace period before doing a Kill.
func (h *execHandle) Kill() error {
h.proc.Signal(os.Interrupt)
h.proc.Signal(unix.SIGTERM)
select {
case <-h.doneCh:
return nil

View file

@ -14,6 +14,8 @@ import (
"strings"
"time"
"golang.org/x/sys/unix"
"github.com/hashicorp/nomad/client/config"
"github.com/hashicorp/nomad/nomad/structs"
)
@ -188,7 +190,7 @@ func (h *javaHandle) Update(task *structs.Task) error {
// Kill is used to terminate the task. We send an Interrupt
// and then provide a 5 second grace period before doing a Kill.
func (h *javaHandle) Kill() error {
h.proc.Signal(os.Interrupt)
h.proc.Signal(unix.SIGTERM)
select {
case <-h.doneCh:
return nil