mirror of
https://github.com/LibreOffice/online.git
synced 2025-08-13 13:17:07 +00:00
Connect USR1 to initial global state dumping goodness.
This commit is contained in:

committed by
Jan Holesovsky

parent
fffd970425
commit
fa96673ee0
@ -39,6 +39,7 @@
|
||||
#include "Util.hpp"
|
||||
|
||||
std::atomic<bool> TerminationFlag(false);
|
||||
std::atomic<bool> DumpGlobalState(false);
|
||||
std::mutex SigHandlerTrap;
|
||||
|
||||
/// Flag to shutdown the server.
|
||||
@ -247,6 +248,32 @@ namespace SigUtil
|
||||
strncpy(FatalGdbString, streamStr.c_str(), sizeof(FatalGdbString));
|
||||
}
|
||||
|
||||
static
|
||||
void handleUserSignal(const int signal)
|
||||
{
|
||||
Log::signalLogPrefix();
|
||||
Log::signalLog(" User signal received: ");
|
||||
Log::signalLog(signalName(signal));
|
||||
Log::signalLog("\n");
|
||||
if (signal == SIGUSR1)
|
||||
{
|
||||
DumpGlobalState = true;
|
||||
SocketPoll::wakeupWorld();
|
||||
}
|
||||
}
|
||||
|
||||
void setUserSignals()
|
||||
{
|
||||
struct sigaction action;
|
||||
|
||||
sigemptyset(&action.sa_mask);
|
||||
action.sa_flags = 0;
|
||||
action.sa_handler = handleUserSignal;
|
||||
|
||||
sigaction(SIGUSR1, &action, nullptr);
|
||||
}
|
||||
|
||||
|
||||
void requestShutdown()
|
||||
{
|
||||
ShutdownRequestFlag = true;
|
||||
|
Reference in New Issue
Block a user