mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Merge pull request #917 from mndrix/reopen-log-file
Reopen log file on SIGHUP
This commit is contained in:
commit
63407fd6e2
3 changed files with 24 additions and 1 deletions
12
src/init.cpp
12
src/init.cpp
|
|
@ -82,6 +82,10 @@ void HandleSIGTERM(int)
|
|||
fRequestShutdown = true;
|
||||
}
|
||||
|
||||
void HandleSIGHUP(int)
|
||||
{
|
||||
fReopenDebugLog = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -291,7 +295,13 @@ bool AppInit2()
|
|||
sa.sa_flags = 0;
|
||||
sigaction(SIGTERM, &sa, NULL);
|
||||
sigaction(SIGINT, &sa, NULL);
|
||||
sigaction(SIGHUP, &sa, NULL);
|
||||
|
||||
// Reopen debug.log on SIGHUP
|
||||
struct sigaction sa_hup;
|
||||
sa_hup.sa_handler = HandleSIGHUP;
|
||||
sigemptyset(&sa_hup.sa_mask);
|
||||
sa_hup.sa_flags = 0;
|
||||
sigaction(SIGHUP, &sa_hup, NULL);
|
||||
#endif
|
||||
|
||||
fTestNet = GetBoolArg("-testnet");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue