From 1850c04d6508d8e1b09e3f39466c2d276abefb51 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 24 Aug 2022 11:43:21 +0300 Subject: [PATCH] cli/server: handle SIGTERM gracefully That's the expected and desired behavior, SIGKILL is always there to do bad things. --- cli/server/server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/server/server.go b/cli/server/server.go index 7e5fa53a8..827b853b7 100644 --- a/cli/server/server.go +++ b/cli/server/server.go @@ -8,6 +8,7 @@ import ( "os" "os/signal" "runtime" + "syscall" "time" "github.com/nspcc-dev/neo-go/cli/cmdargs" @@ -119,6 +120,7 @@ func newGraceContext() context.Context { ctx, cancel := context.WithCancel(context.Background()) stop := make(chan os.Signal, 1) signal.Notify(stop, os.Interrupt) + signal.Notify(stop, syscall.SIGTERM) go func() { <-stop cancel()