mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Merge #15278: Improve PID file error handling
3782075a5fMove all PID file stuff to init.cpp (Hennadii Stepanov)561e375c73Make PID file creating errors fatal (Hennadii Stepanov)745a2ace18Improve PID file removing errors logging (Hennadii Stepanov) Pull request description: Digging into #15240 the lack of the proper logging has been discovered. Fixed by this PR. UPDATE (inspired by @laanwj's [comment](https://github.com/bitcoin/bitcoin/pull/15278#discussion_r252641810)): Not being able to create the PID file is fatal now. Output of `bitcoind`: ``` $ src/bitcoind -pid=/run/bitcoind/bitcoind.pid 2019-02-01T23:20:10Z Bitcoin Core version v0.17.99.0-561e375c7 (release build) 2019-02-01T23:20:10Z Assuming ancestors of block 0000000000000037a8cd3e06cd5edbfe9dd1dbcc5dacab279376ef7cfc2b4c75 have valid signatures. 2019-02-01T23:20:10Z Setting nMinimumChainWork=00000000000000000000000000000000000000000000007dbe94253893cbd463 2019-02-01T23:20:10Z Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation 2019-02-01T23:20:10Z Using RdRand as an additional entropy source 2019-02-01T23:20:11Z Error: Unable to create the PID file '/run/bitcoind/bitcoind.pid': No such file or directory Error: Unable to create the PID file '/run/bitcoind/bitcoind.pid': No such file or directory 2019-02-01T23:20:11Z Shutdown: In progress... 2019-02-01T23:20:11Z Shutdown: Unable to remove PID file: File does not exist 2019-02-01T23:20:11Z Shutdown: done ``` Output of `bitcoin-qt`:  **Notes for reviewers** 1. `CreatePidFile()` has been moved from `util/system.cpp` to `init.cpp` for the following reasons: - to get the ability to use `InitError()` - now `init.cpp` contains code of both creating PID file and removing it 2. Regarding 0.18 release process: this PR modifies 1 string and introduces 2 new ones. Tree-SHA512: ac07d0f800e61ec759e427d0afc0ca43d67f232e977662253963afdd0a220d34b871050f58149fc9fabd427bfc8e0d3f6a6032f2a38f30ad366fc0d074b0f2b3
This commit is contained in:
@@ -40,7 +40,6 @@
|
||||
int64_t GetStartupTime();
|
||||
|
||||
extern const char * const BITCOIN_CONF_FILENAME;
|
||||
extern const char * const BITCOIN_PID_FILENAME;
|
||||
|
||||
/** Translate a message to the native language of the user. */
|
||||
const extern std::function<std::string(const char*)> G_TRANSLATION_FUN;
|
||||
@@ -86,10 +85,6 @@ const fs::path &GetBlocksDir();
|
||||
const fs::path &GetDataDir(bool fNetSpecific = true);
|
||||
void ClearDatadirCache();
|
||||
fs::path GetConfigFile(const std::string& confPath);
|
||||
#ifndef WIN32
|
||||
fs::path GetPidFile();
|
||||
void CreatePidFile(const fs::path &path, pid_t pid);
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
fs::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user