lighthouse/beacon_node
Mason Stallmo bc14d1d73d Add more unix signal handlers (#2486)
## Issue Addressed

Resolves #2114 

Swapped out the ctrlc crate for tokio signals to hook register handlers for SIGPIPE and SIGHUP along with SIGTERM and SIGINT.

## Proposed Changes

- Swap out the ctrlc crate for tokio signals for unix signal handing
- Register signals for SIGPIPE and SHIGUP that trigger the same shutdown procedure as SIGTERM and SIGINT

## Additional Info

I tested these changes against the examples in the original issue and noticed some interesting behavior on my machine. When running `lighthouse bn --network pyrmont |& tee -a pyrmont_bn.log` or `lighthouse bn --network pyrmont 2>&1 | tee -a pyrmont_bn.log` none of the above signals are sent to the lighthouse program in a way I was able to observe. 

The only time it seems that the signal gets sent to the lighthouse program is if there is no redirection of stderr to stdout. I'm not as familiar with the details of how unix signals work in linux with a redirect like that so I'm not sure if this is a bug in the program or expected behavior.

Signals are correctly received without the redirection and if the above signals are sent directly to the program with something like `kill`.
2021-08-30 05:19:34 +00:00
..
beacon_chain Metrics and DEBG log for late gossip blocks (#2533) 2021-08-23 00:59:14 +00:00
client Upgrade dependencies (#2513) 2021-08-17 01:00:24 +00:00
eth1 Improve eth1 fallback logging (#2490) 2021-08-30 00:51:26 +00:00
eth2_libp2p Expand gossip duplicate cache time (#2542) 2021-08-26 23:25:50 +00:00
genesis Upgrade dependencies (#2513) 2021-08-17 01:00:24 +00:00
http_api Fork schedule api (#2525) 2021-08-24 01:36:27 +00:00
http_metrics Upgrade dependencies (#2513) 2021-08-17 01:00:24 +00:00
network Remove penality for duplicate attestation from same validator (#2540) 2021-08-26 08:00:50 +00:00
operation_pool Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
src Packet filter cli option (#2523) 2021-08-26 00:29:39 +00:00
store Rust 1.54.0 lints (#2483) 2021-07-30 01:11:47 +00:00
tests Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
timer Upgrade dependencies (#2513) 2021-08-17 01:00:24 +00:00
websocket_server Server sent events (#1920) 2020-12-04 00:18:58 +00:00
Cargo.toml Add more unix signal handlers (#2486) 2021-08-30 05:19:34 +00:00