mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-10 10:52:31 -05:00
Remove PID file at the very end
This commit is contained in:
parent
c8971547d9
commit
7fcdec0f32
1 changed files with 9 additions and 7 deletions
16
src/init.cpp
16
src/init.cpp
|
@ -278,13 +278,6 @@ void Shutdown(NodeContext& node)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
try {
|
|
||||||
if (!fs::remove(GetPidFile())) {
|
|
||||||
LogPrintf("%s: Unable to remove PID file: File does not exist\n", __func__);
|
|
||||||
}
|
|
||||||
} catch (const fs::filesystem_error& e) {
|
|
||||||
LogPrintf("%s: Unable to remove PID file: %s\n", __func__, fsbridge::get_filesystem_error_message(e));
|
|
||||||
}
|
|
||||||
node.chain_clients.clear();
|
node.chain_clients.clear();
|
||||||
UnregisterAllValidationInterfaces();
|
UnregisterAllValidationInterfaces();
|
||||||
GetMainSignals().UnregisterBackgroundSignalScheduler();
|
GetMainSignals().UnregisterBackgroundSignalScheduler();
|
||||||
|
@ -292,6 +285,15 @@ void Shutdown(NodeContext& node)
|
||||||
ECC_Stop();
|
ECC_Stop();
|
||||||
if (node.mempool) node.mempool = nullptr;
|
if (node.mempool) node.mempool = nullptr;
|
||||||
node.scheduler.reset();
|
node.scheduler.reset();
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (!fs::remove(GetPidFile())) {
|
||||||
|
LogPrintf("%s: Unable to remove PID file: File does not exist\n", __func__);
|
||||||
|
}
|
||||||
|
} catch (const fs::filesystem_error& e) {
|
||||||
|
LogPrintf("%s: Unable to remove PID file: %s\n", __func__, fsbridge::get_filesystem_error_message(e));
|
||||||
|
}
|
||||||
|
|
||||||
LogPrintf("%s: done\n", __func__);
|
LogPrintf("%s: done\n", __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue