Skip to content

Commit

Permalink
Added debug messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
dchapyshev committed Nov 14, 2023
1 parent 466fd52 commit f2870cc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
32 changes: 25 additions & 7 deletions source/base/service_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<ScopedCryptoInitializer> crypto_initializer =
std::make_unique<ScopedCryptoInitializer>();
CHECK(crypto_initializer->isSucceeded());

LOG(LS_INFO) << "Cryptography initialized successfully";

message_loop_ = std::make_unique<MessageLoop>(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();

Expand Down
1 change: 1 addition & 0 deletions source/router/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ int main(int argc, const char* const* argv)
}
else
{
LOG(LS_INFO) << "Starting router services";
router::Service().exec();
}
}
Expand Down

0 comments on commit f2870cc

Please sign in to comment.