fix(userspace/falco): stabilize termination signal handler

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
Jason Dellaluce
2022-10-06 14:37:40 +00:00
committed by poiana
parent 59ba2f9aab
commit b4ea2f4da2
2 changed files with 3 additions and 4 deletions

View File

@@ -75,15 +75,14 @@ bool application::create_handler(int sig, void (*func)(int), run_result &ret)
application::run_result application::create_signal_handlers()
{
run_result ret;
s_app = *this;
if(! create_handler(SIGINT, ::signal_callback, ret) ||
! create_handler(SIGTERM, ::signal_callback, ret) ||
! create_handler(SIGUSR1, ::reopen_outputs, ret) ||
! create_handler(SIGHUP, ::restart_falco, ret))
{
return ret;
s_app = dummy;
}
s_app = *this;
return ret;
}

View File

@@ -137,7 +137,6 @@ bool application::run(std::string &errstr, bool &restart)
std::bind(&application::print_ignored_events, this),
std::bind(&application::print_syscall_events, this),
std::bind(&application::load_config, this),
std::bind(&application::create_signal_handlers, this),
std::bind(&application::print_plugin_info, this),
std::bind(&application::list_plugins, this),
std::bind(&application::load_plugins, this),
@@ -148,6 +147,7 @@ bool application::run(std::string &errstr, bool &restart)
std::bind(&application::validate_rules_files, this),
std::bind(&application::load_rules_files, this),
std::bind(&application::print_support, this),
std::bind(&application::create_signal_handlers, this),
std::bind(&application::attach_inotify_signals, this),
std::bind(&application::create_requested_paths, this),
std::bind(&application::daemonize, this),