I'm using boost signal handler in order to properly teardown my process when a signal arrives (SIGTERM, SIGSEGV and SIGABRT).
However, after the teardown the process, I'd like to continue the default system flow of signal handling (that terminates the process and generate crash dump file).
How should I do call this default handler from my callback ?
Thanks !
#include <boost/asio/signal_set.hpp>
void signal_handler() {
boost::thread([](){
boost::asio::io_context io_context;
boost::asio::signal_set signals(io_context, SIGTERM, SIGSEGV, SIGABRT);
spdlog::debug("Started waiting for signals");
signals.async_wait([](const boost::system::error_code& error,
int signal_number) {
if (!error) {
print(std::fmt("got signal {}. teardown the process", signal_number));
teardown();
} else {
print("error in getting the signal");
}
// HERE I'd like to call the standard signal handler in order to produce crash
// dump file and kill the process.
});
io_context.run();
});
}