diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-04-04 22:50:40 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-04-06 17:12:32 +0300 |
commit | 7fcdec0f326f7fb547ec9c651871842cf518ea38 (patch) | |
tree | a195b3b890bf69347cf740ef4c9c2f48f57841c6 | |
parent | c8971547d9c9460fcbec6f54888df83f002c3dfd (diff) |
Remove PID file at the very end
-rw-r--r-- | src/init.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/init.cpp b/src/init.cpp index 88caed9ded..076e2ceacf 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -278,13 +278,6 @@ void Shutdown(NodeContext& node) } #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(); UnregisterAllValidationInterfaces(); GetMainSignals().UnregisterBackgroundSignalScheduler(); @@ -292,6 +285,15 @@ void Shutdown(NodeContext& node) ECC_Stop(); if (node.mempool) node.mempool = nullptr; 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__); } |