Skip to content

Commit

Permalink
Update termination handling
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasjackson committed Jan 3, 2022
1 parent 55fe6c8 commit abb0ca0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"path"
"runtime"
"strings"
"syscall"
"time"

"github.com/hashicorp/go-hclog"
Expand Down Expand Up @@ -284,7 +285,7 @@ func main() {
var err error
err = httpServer.Serve(httpListener)

if err != nil && err != cmux.ErrServerClosed {
if err != nil && err != http.ErrServerClosed {
logger.Log().Error("Error starting http server", "error", err)
os.Exit(1)
}
Expand All @@ -306,8 +307,7 @@ func main() {

// trap sigterm or interupt and gracefully shutdown the server
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
signal.Notify(c, os.Kill)
signal.Notify(c, os.Interrupt, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)

// Block until a signal is received.
sig := <-c
Expand Down

0 comments on commit abb0ca0

Please sign in to comment.