File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,11 @@ import (
21
21
"fmt"
22
22
"io/ioutil"
23
23
"os"
24
+ "os/signal"
24
25
"runtime"
25
26
"strconv"
26
27
"strings"
28
+ "syscall"
27
29
28
30
"github.com/ethereum/go-ethereum/accounts"
29
31
"github.com/ethereum/go-ethereum/accounts/keystore"
@@ -271,6 +273,14 @@ func bzzd(ctx *cli.Context) error {
271
273
stack := utils .MakeNode (ctx , clientIdentifier , gitCommit )
272
274
registerBzzService (ctx , stack )
273
275
utils .StartNode (stack )
276
+ go func () {
277
+ sigc := make (chan os.Signal , 1 )
278
+ signal .Notify (sigc , syscall .SIGTERM )
279
+ defer signal .Stop (sigc )
280
+ <- sigc
281
+ glog .V (logger .Info ).Infoln ("Got sigterm, shutting down..." )
282
+ stack .Stop ()
283
+ }()
274
284
networkId := ctx .GlobalUint64 (SwarmNetworkIdFlag .Name )
275
285
// Add bootnodes as initial peers.
276
286
if ctx .GlobalIsSet (utils .BootnodesFlag .Name ) {
You can’t perform that action at this time.
0 commit comments