mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-13 13:32:50 +00:00
fix(userspace/falco): stabilize termination signal handler
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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),
|
||||
|
Reference in New Issue
Block a user