Browse Source

don't initiate graceful shutdown twice

pull/462/head
orignal 9 years ago
parent
commit
8366c8d2a7
  1. 5
      DaemonLinux.cpp

5
DaemonLinux.cpp

@ -23,9 +23,14 @@ void handle_signal(int sig)
i2p::log::Logger().Reopen (); i2p::log::Logger().Reopen ();
break; break;
case SIGINT: case SIGINT:
if (i2p::context.AcceptsTunnels () && !Daemon.gracefullShutdownInterval)
{
i2p::context.SetAcceptsTunnels (false); 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");
}
else
Daemon.running = 0;
break; break;
case SIGABRT: case SIGABRT:
case SIGTERM: case SIGTERM:

Loading…
Cancel
Save