Merge pull request #89 from majestrate/fix-issue-88

handle SIGTERM
This commit is contained in:
Jeff 2018-11-29 08:14:05 -05:00 committed by GitHub
commit a811d1138d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -166,6 +166,7 @@ main(int argc, char *argv[])
if(ctx) if(ctx)
{ {
signal(SIGINT, handle_signal); signal(SIGINT, handle_signal);
signal(SIGTERM, handle_signal);
#ifndef _WIN32 #ifndef _WIN32
signal(SIGHUP, handle_signal); signal(SIGHUP, handle_signal);
#endif #endif

View File

@ -184,9 +184,8 @@ namespace llarp
void void
Context::HandleSignal(int sig) Context::HandleSignal(int sig)
{ {
if(sig == SIGINT) if(sig == SIGINT || sig == SIGTERM)
{ {
llarp::LogInfo("SIGINT");
SigINT(); SigINT();
} }
// TODO(despair): implement hot-reloading config on NT // TODO(despair): implement hot-reloading config on NT