mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Initiate termination process on SIGTERM as well
This commit is contained in:
parent
53a4d17f8b
commit
02692e7002
|
@ -23,6 +23,7 @@ namespace
|
||||||
{
|
{
|
||||||
std::atomic<sig_atomic_t> gLastSignal(0);
|
std::atomic<sig_atomic_t> gLastSignal(0);
|
||||||
std::atomic<int> gSignalCount(0);
|
std::atomic<int> gSignalCount(0);
|
||||||
|
std::atomic<bool> gSigtermRequested(false);
|
||||||
|
|
||||||
extern "C" auto sigint_handler(int signal) -> void
|
extern "C" auto sigint_handler(int signal) -> void
|
||||||
{
|
{
|
||||||
|
@ -36,6 +37,8 @@ namespace
|
||||||
|
|
||||||
extern "C" auto sigterm_handler(int signal) -> void
|
extern "C" auto sigterm_handler(int signal) -> void
|
||||||
{
|
{
|
||||||
|
++gSignalCount;
|
||||||
|
gSigtermRequested = true;
|
||||||
gLastSignal = signal;
|
gLastSignal = signal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -395,7 +398,7 @@ auto Control::SignalHandler() -> void
|
||||||
this_thread::sleep_for(chrono::milliseconds(100));
|
this_thread::sleep_for(chrono::milliseconds(100));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fPluginShutdownRequested) {
|
if (!fPluginShutdownRequested || gSigtermRequested) {
|
||||||
LOG(info) << "Received device shutdown request (signal " << gLastSignal << ").";
|
LOG(info) << "Received device shutdown request (signal " << gLastSignal << ").";
|
||||||
LOG(info) << "Waiting for graceful device shutdown. Hit Ctrl-C again to abort immediately.";
|
LOG(info) << "Waiting for graceful device shutdown. Hit Ctrl-C again to abort immediately.";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user