Browse Source

graceful shutdown by SIGINT

pull/458/merge
orignal 9 years ago
parent
commit
ac2e1709f8
  1. 2
      DaemonLinux.cpp

2
DaemonLinux.cpp

@ -12,6 +12,7 @@
#include "Config.h" #include "Config.h"
#include "FS.h" #include "FS.h"
#include "Log.h" #include "Log.h"
#include "RouterContext.h"
void handle_signal(int sig) void handle_signal(int sig)
{ {
@ -22,6 +23,7 @@ void handle_signal(int sig)
i2p::log::Logger().Reopen (); i2p::log::Logger().Reopen ();
break; break;
case SIGINT: case SIGINT:
i2p::context.SetAcceptsTunnels (false);
Daemon.gracefullShutdownInterval = 10*60; // 10 minutes Daemon.gracefullShutdownInterval = 10*60; // 10 minutes
LogPrint(eLogInfo, "Graceful shutdown after ", Daemon.gracefullShutdownInterval, " seconds"); LogPrint(eLogInfo, "Graceful shutdown after ", Daemon.gracefullShutdownInterval, " seconds");
break; break;

Loading…
Cancel
Save