Don’t close old debug log file handle prematurely when trying to re-open (on SIGHUP
).
Context: #13148 (comment)
Thanks @ajtowns!
Don’t close old debug log file handle prematurely when trying to re-open (on SIGHUP
).
Context: #13148 (comment)
Thanks @ajtowns!
Tested ACK 37efe5b7ea059e56d8f5170c91e3160db286cad4
To test:
0$ bitcoind -regtest -daemon
1$ cd ~/.bitcoin/regtest
2$ mv debug.log{,.old}
3$ touch debug.log; chmod 400 debug.log
4$ killall -HUP bitcoind
5$ bitcoin-cli -regtest savemempool
Current behaviour of master is that the “Dumped mempool” message (along with any other subsequent log messages) aren’t logged to a file, and further that fixing permissions on debug.log and HUP’ing the process isn’t sufficient to re-enable logging to file.
With the patch, logging continues in debug.log.old, and after fixing the permissions HUP’ing the process causes logging to move to the new file.
freopen
I suppose