From b7e87eef05fa02a35778e8771df33587f86cc13e Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Tue, 12 Apr 2022 01:20:43 +1200 Subject: [PATCH] cli: add graceful catches to SIGINT (#8308) --- cmd/tendermint/commands/light.go | 2 +- cmd/tendermint/commands/run_node.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/tendermint/commands/light.go b/cmd/tendermint/commands/light.go index fbb6e00db..8e39d7900 100644 --- a/cmd/tendermint/commands/light.go +++ b/cmd/tendermint/commands/light.go @@ -180,7 +180,7 @@ for applications built w/ Cosmos SDK). return err } - ctx, cancel := signal.NotifyContext(cmd.Context(), syscall.SIGTERM) + ctx, cancel := signal.NotifyContext(cmd.Context(), os.Interrupt, syscall.SIGTERM) defer cancel() go func() { diff --git a/cmd/tendermint/commands/run_node.go b/cmd/tendermint/commands/run_node.go index 5f39fb21e..347a04034 100644 --- a/cmd/tendermint/commands/run_node.go +++ b/cmd/tendermint/commands/run_node.go @@ -105,7 +105,7 @@ func NewRunNodeCmd(nodeProvider cfg.ServiceProvider, conf *cfg.Config, logger lo return err } - ctx, cancel := signal.NotifyContext(cmd.Context(), syscall.SIGTERM) + ctx, cancel := signal.NotifyContext(cmd.Context(), os.Interrupt, syscall.SIGTERM) defer cancel() n, err := nodeProvider(ctx, conf, logger)