|
|
@ -60,7 +60,7 @@ void handle_signal(int sig) |
|
|
|
i2p::transport::transports.SetOnline(false); |
|
|
|
i2p::transport::transports.SetOnline(false); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SIGCONT: |
|
|
|
case SIGCONT: |
|
|
|
LogPrint(eLogInfo, "Daemon: Got SIGCONT, restore connection to network..."); |
|
|
|
LogPrint(eLogInfo, "Daemon: Got SIGCONT, restoring connection to network..."); |
|
|
|
i2p::transport::transports.SetOnline(true); |
|
|
|
i2p::transport::transports.SetOnline(true); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -180,6 +180,9 @@ namespace i2p |
|
|
|
} |
|
|
|
} |
|
|
|
gracefulShutdownInterval = 0; // not specified
|
|
|
|
gracefulShutdownInterval = 0; // not specified
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// handle signal TSTP
|
|
|
|
|
|
|
|
bool handleTSTP; i2p::config::GetOption("unix.handle_sigtstp", handleTSTP); |
|
|
|
|
|
|
|
|
|
|
|
// Signal handler
|
|
|
|
// Signal handler
|
|
|
|
struct sigaction sa; |
|
|
|
struct sigaction sa; |
|
|
|
sa.sa_handler = handle_signal; |
|
|
|
sa.sa_handler = handle_signal; |
|
|
@ -191,6 +194,11 @@ namespace i2p |
|
|
|
sigaction(SIGTERM, &sa, 0); |
|
|
|
sigaction(SIGTERM, &sa, 0); |
|
|
|
sigaction(SIGINT, &sa, 0); |
|
|
|
sigaction(SIGINT, &sa, 0); |
|
|
|
sigaction(SIGPIPE, &sa, 0); |
|
|
|
sigaction(SIGPIPE, &sa, 0); |
|
|
|
|
|
|
|
if (handleTSTP) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
sigaction(SIGTSTP, &sa, 0); |
|
|
|
|
|
|
|
sigaction(SIGCONT, &sa, 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return Daemon_Singleton::start(); |
|
|
|
return Daemon_Singleton::start(); |
|
|
|
} |
|
|
|
} |
|
|
|