Commit 40f2dc6a authored by Frank Denis's avatar Frank Denis

Apply kardianos/service PR #144

parent e3d5f3e6
...@@ -11,6 +11,7 @@ import ( ...@@ -11,6 +11,7 @@ import (
"os/signal" "os/signal"
"regexp" "regexp"
"strings" "strings"
"syscall"
"text/template" "text/template"
"time" "time"
) )
...@@ -186,7 +187,7 @@ func (s *upstart) Run() (err error) { ...@@ -186,7 +187,7 @@ func (s *upstart) Run() (err error) {
s.Option.funcSingle(optionRunWait, func() { s.Option.funcSingle(optionRunWait, func() {
var sigChan = make(chan os.Signal, 3) var sigChan = make(chan os.Signal, 3)
signal.Notify(sigChan, os.Interrupt, os.Kill) signal.Notify(sigChan, syscall.SIGTERM, os.Interrupt)
<-sigChan <-sigChan
})() })()
......
...@@ -268,7 +268,7 @@ func (ws *windowsService) Run() error { ...@@ -268,7 +268,7 @@ func (ws *windowsService) Run() error {
sigChan := make(chan os.Signal) sigChan := make(chan os.Signal)
signal.Notify(sigChan, os.Interrupt, os.Kill) signal.Notify(sigChan, os.Interrupt)
<-sigChan <-sigChan
...@@ -311,7 +311,7 @@ func (ws *windowsService) Status() (Status, error) { ...@@ -311,7 +311,7 @@ func (ws *windowsService) Status() (Status, error) {
case svc.Stopped: case svc.Stopped:
return StatusStopped, nil return StatusStopped, nil
default: default:
return StatusUnknown, fmt.Errorf("unknown status %s", status) return StatusUnknown, fmt.Errorf("unknown status %v", status)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment