diff --git a/source/base/service_posix.cc b/source/base/service_posix.cc index 88e1bcb508..f29433d440 100644 --- a/source/base/service_posix.cc +++ b/source/base/service_posix.cc @@ -75,23 +75,41 @@ void Service::exec() { LOG(LS_INFO) << "Begin"; - signal(SIGKILL, signalHandler); - signal(SIGTERM, signalHandler); - signal(SIGHUP, signalHandler); - signal(SIGQUIT, signalHandler); - signal(SIGINT, signalHandler); - signal(SIGSTOP, signalHandler); - signal(SIGABRT, signalHandler); + if (signal(SIGKILL, signalHandler) == SIG_ERR) + LOG(LS_ERROR) << "Unable to install signal handler for SIGKILL"; + + if (signal(SIGTERM, signalHandler) == SIG_ERR) + LOG(LS_ERROR) << "Unable to install signal handler for SIGTERM"; + + if (signal(SIGHUP, signalHandler) == SIG_ERR) + LOG(LS_ERROR) << "Unable to install signal handler for SIGHUP"; + + if (signal(SIGQUIT, signalHandler) == SIG_ERR) + LOG(LS_ERROR) << "Unable to install signal handler for SIGQUIT"; + + if (signal(SIGINT, signalHandler) == SIG_ERR) + LOG(LS_ERROR) << "Unable to install signal handler for SIGQUIT"; + + if (signal(SIGSTOP, signalHandler) == SIG_ERR) + LOG(LS_ERROR) << "Unable to install signal handler for SIGSTOP"; + + if (signal(SIGABRT, signalHandler) == SIG_ERR) + LOG(LS_ERROR) << "Unable to install signal handler for SIGABRT"; std::unique_ptr crypto_initializer = std::make_unique(); CHECK(crypto_initializer->isSucceeded()); + LOG(LS_INFO) << "Cryptography initialized successfully"; + message_loop_ = std::make_unique(type_); task_runner_ = message_loop_->taskRunner(); + LOG(LS_INFO) << "Message loop created"; + task_runner_->postTask(std::bind(&Service::onStart, this)); + LOG(LS_INFO) << "Run message loop"; message_loop_->run(); message_loop_.reset(); diff --git a/source/router/main.cc b/source/router/main.cc index 88a9fd1050..7cb4f219e8 100644 --- a/source/router/main.cc +++ b/source/router/main.cc @@ -304,6 +304,7 @@ int main(int argc, const char* const* argv) } else { + LOG(LS_INFO) << "Starting router services"; router::Service().exec(); } }