node: Respond always to OS interrupts (#2479)

* stop node upon receiving SIGTERM or CTRL-Ceven during genesis sleep by setting up interrupt before starting a node

Closes #2434

* call Start, not OnStart when starting a component to avoid:

```
E[09-24|10:13:15.805] Not stopping PubSub -- have not been started yet module=pubsub impl=PubSub
```

being printed on exit
This commit is contained in:
Anton Kaliaev
2018-09-25 12:24:18 +02:00
committed by Alexander Simmerl
parent d297f02227
commit d12e55c494
5 changed files with 26 additions and 13 deletions
+5 -1
View File
@@ -207,7 +207,11 @@ func (mt *MultiplexTransport) Dial(
func (mt *MultiplexTransport) Close() error {
close(mt.closec)
return mt.listener.Close()
if mt.listener != nil {
return mt.listener.Close()
}
return nil
}
// Listen implements transportLifecycle.