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!
utACK
<!--5d09a71f8925f3f132321140b44b946d-->The last travis run for this pull request was 80 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened.
Tested ACK 37efe5b7ea059e56d8f5170c91e3160db286cad4
To test:
$ bitcoind -regtest -daemon
$ cd ~/.bitcoin/regtest
$ mv debug.log{,.old}
$ touch debug.log; chmod 400 debug.log
$ killall -HUP bitcoind
$ 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.
utACK 37efe5b7ea059e56d8f5170c91e3160db286cad4
Rebased! @luke-jr @ajtowns @MarcoFalke Please re-review :-)
re-utACK 75ea00f391b742e435c650aae3e827aad913d552
re-ACK 75ea00f391b742e435c650aae3e827aad913d552
utACK 75ea00f391b742e435c650aae3e827aad913d552, good to get rid of the need of freopen I suppose