1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 12:24:19 +00:00

graceful shutdown by SIGINT

This commit is contained in:
orignal 2016-03-29 12:50:34 -04:00
parent db88183a23
commit ac2e1709f8

View File

@ -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;