Proper shutdown on SIGHUP

If a process exits and has a controlling terminal, everything under
it gets a SIGHUP by the kernel. That's the case for instance when
running a srsUE over ssh with some specific parameters. As a result,
when the ssh client is killed, SIGHUP is sent to srsUE, which will be
killed immediatelly without proper release, which means in turn that log
buffers are not flushed.
Let's do proper shutdown when SIGHUP is received so that everyone can
get log files.
master
Pau Espin Pedrol 5 years ago committed by Andre Puschmann
parent 64de92183b
commit 4949df257e

@ -424,6 +424,7 @@ int main(int argc, char* argv[])
{ {
signal(SIGINT, sig_int_handler); signal(SIGINT, sig_int_handler);
signal(SIGTERM, sig_int_handler); signal(SIGTERM, sig_int_handler);
signal(SIGHUP, sig_int_handler);
all_args_t args = {}; all_args_t args = {};
srslte::metrics_hub<enb_metrics_t> metricshub; srslte::metrics_hub<enb_metrics_t> metricshub;
metrics_stdout metrics_screen; metrics_stdout metrics_screen;

@ -384,6 +384,7 @@ int main(int argc, char* argv[])
{ {
signal(SIGINT, sig_int_handler); signal(SIGINT, sig_int_handler);
signal(SIGTERM, sig_int_handler); signal(SIGTERM, sig_int_handler);
signal(SIGHUP, sig_int_handler);
// print build info // print build info
cout << endl << get_build_string() << endl; cout << endl << get_build_string() << endl;

@ -190,6 +190,7 @@ int main(int argc, char* argv[])
cout << endl << "--- Software Radio Systems MBMS ---" << endl << endl; cout << endl << "--- Software Radio Systems MBMS ---" << endl << endl;
signal(SIGINT, sig_int_handler); signal(SIGINT, sig_int_handler);
signal(SIGTERM, sig_int_handler); signal(SIGTERM, sig_int_handler);
signal(SIGHUP, sig_int_handler);
all_args_t args; all_args_t args;
parse_args(&args, argc, argv); parse_args(&args, argc, argv);

@ -553,6 +553,7 @@ int main(int argc, char* argv[])
{ {
signal(SIGINT, sig_int_handler); signal(SIGINT, sig_int_handler);
signal(SIGTERM, sig_int_handler); signal(SIGTERM, sig_int_handler);
signal(SIGHUP, sig_int_handler);
srslte_debug_handle_crash(argc, argv); srslte_debug_handle_crash(argc, argv);
all_args_t args = {}; all_args_t args = {};

Loading…
Cancel
Save