0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-09 10:43:19 -05:00
bitcoin-bitcoin-core/src
MarcoFalke 92dcbe9cc3
Merge bitcoin/bitcoin#23395: util: Add -shutdownnotify option
d96d97ad30  doc: Add release note for shutdownnotify. (klementtan)
0bd73e2c45 util: Add -shutdownnotify option. (klementtan)

Pull request description:

  **Description**: Similar to `-startupnotify`, this PR adds a new option to allow users to specify a command to be executed when Bitcoin Core shuts down.

  **Note**: The `shutdownnotify` commands will not be executed if bitcoind shut down due to *unexpected* reasons (ie `killall -9 bitcoind`).

  ### Testing:
  **Normal shutdown commands**
  ```
  # start bitcoind with shutdownnotify optioin
  ./src/bitcoind -signet -shutdownnotify="touch foo.txt"

  # shutdown bitcoind
  ./src/bitcoin-cli -signet stop

  # check that foo.txt has been created
  ```

  **Final RPC call**
  Commands:
  ```
  $  ./src/bitcoind -signet -nolisten -noconnect -shutdownnotify="./src/bitcoin-cli -signet getblockchaininfo > tmp.txt"
  $ ./src/bitcoin-cli stop
  $ cat tmp.txt
  ```
  <details>
  <summary>Screen Shot</summary>

  ![image](https://user-images.githubusercontent.com/49265907/141186183-cbc6f82c-400d-4a8b-baba-27c0346c2c8a.png)
  </details>

ACKs for top commit:
  achow101:
    ACK d96d97ad30
  1440000bytes:
    ACK d96d97ad30
  theStack:
    re-ACK d96d97ad30

Tree-SHA512: 16f7406fd232e8b97aea5e58854c84755b0c35c88cb3ef9ee123b29a1475a376122b1e100da860cc336d4d657e6046a70e915fdb9b70c9fd097c6eef1b028161
2023-01-19 10:34:54 +01:00
..
bench Merge bitcoin/bitcoin#26251: refactor: add kernel/cs_main.h 2023-01-16 13:44:56 +01:00
common scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
compat compat: use STDIN_FILENO over 0 2023-01-04 12:00:25 +00:00
config
consensus Merge bitcoin/bitcoin#26603: doc: CalculateSequenceLocks: prevHeights entries are set to 0, not removed 2023-01-04 18:07:31 +00:00
crc32c Update crc32c subtree to latest upstream master 2022-08-13 13:55:38 +01:00
crypto refactor: use braced init for integer constants instead of c style casts 2023-01-03 19:31:29 -06:00
index scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
init scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
interfaces Merge bitcoin/bitcoin#26752: wallet: Remove mempool_sequence from interface methods 2023-01-04 17:53:58 +00:00
ipc scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
kernel Merge bitcoin/bitcoin#26251: refactor: add kernel/cs_main.h 2023-01-16 13:44:56 +01:00
leveldb Update leveldb-subtree subtree to latest upstream 2022-09-29 16:43:30 +01:00
logging scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
minisketch Update minisketch subtree to latest upstream 2022-10-23 15:03:04 +01:00
node Merge bitcoin/bitcoin#26251: refactor: add kernel/cs_main.h 2023-01-16 13:44:56 +01:00
policy Merge bitcoin/bitcoin#26289: Use util::Result in for calculating mempool ancestors 2023-01-03 16:30:55 -05:00
primitives scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
qt Merge bitcoin-core/gui#686: clang-tidy: Force checks for headers in src/qt 2023-01-17 09:54:56 +00:00
rpc Merge bitcoin/bitcoin#26706: doc: Properly report optional RPC args 2023-01-18 15:43:00 +00:00
script Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
secp256k1 Update secp256k1 subtree to upstream libsecp256k1 version 0.2.0 2022-12-12 23:40:36 -05:00
support scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
test Merge bitcoin/bitcoin#26251: refactor: add kernel/cs_main.h 2023-01-16 13:44:56 +01:00
univalue scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
util refactor: use braced init for integer constants instead of c style casts 2023-01-03 19:31:29 -06:00
wallet Merge bitcoin/bitcoin#25659: wallet: simplify ListCoins implementation 2023-01-18 14:26:39 -05:00
zmq refactor: add kernel/cs_main.* 2023-01-05 09:05:14 +00:00
.bear-tidy-config
.clang-format
.clang-tidy refactor: Remove duplication of clang-tidy's check names 2023-01-17 15:40:29 +00:00
addrdb.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
addrdb.h
addrman.cpp clang-tidy: Add performance-no-automatic-move check 2022-12-27 15:25:51 +00:00
addrman.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
addrman_impl.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
arith_uint256.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
arith_uint256.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
attributes.h
banman.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
banman.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
base58.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
base58.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
bech32.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
bech32.h
bitcoin-chainstate.cpp scripted-diff: rename CChainState -> Chainstate 2022-09-09 11:47:27 -04:00
bitcoin-cli-res.rc
bitcoin-cli.cpp Merge bitcoin/bitcoin#26328: doc: fix -netinfo relaytxes help 2023-01-11 16:39:11 +00:00
bitcoin-tx-res.rc
bitcoin-tx.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
bitcoin-util-res.rc
bitcoin-util.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
bitcoin-wallet-res.rc
bitcoin-wallet.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
bitcoind-res.rc
bitcoind.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
blockencodings.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
blockencodings.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
blockfilter.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
blockfilter.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
chain.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
chain.h refactor: add kernel/cs_main.* 2023-01-05 09:05:14 +00:00
chainparams.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
chainparams.h
chainparamsbase.cpp
chainparamsbase.h
chainparamsseeds.h Merge bitcoin/bitcoin#25853: net: update testnet torv3 hardcoded seeds for 24.x 2022-09-09 10:07:39 +02:00
checkqueue.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
clientversion.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
clientversion.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
coins.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
coins.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
compressor.cpp
compressor.h
core_io.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
core_memusage.h
core_read.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
core_write.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
cuckoocache.h refactor: use braced init for integer constants instead of c style casts 2023-01-03 19:31:29 -06:00
dbwrapper.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
dbwrapper.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
deploymentinfo.cpp
deploymentinfo.h
deploymentstatus.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
deploymentstatus.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
dummywallet.cpp
external_signer.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
external_signer.h
flatfile.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
flatfile.h
fs.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
fs.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
hash.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
hash.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
headerssync.cpp Move headerssync logging to BCLog::NET 2022-08-30 12:09:04 -04:00
headerssync.h Track headers presync progress and log it 2022-08-29 08:10:35 -04:00
httprpc.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
httprpc.h
httpserver.cpp refactor: Make ThreadHTTP return void 2023-01-05 17:54:08 +00:00
httpserver.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
i2p.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
i2p.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
indirectmap.h
init.cpp Merge bitcoin/bitcoin#23395: util: Add -shutdownnotify option 2023-01-19 10:34:54 +01:00
init.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
key.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
key.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
key_io.cpp
key_io.h
logging.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
logging.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
Makefile.am build: move rpc/request from util lib to common 2023-01-17 11:02:08 +00:00
Makefile.bench.include Merge bitcoin/bitcoin#16981: Improve runtime performance of --reindex 2022-11-15 19:23:39 -05:00
Makefile.crc32c.include
Makefile.leveldb.include
Makefile.minisketch.include
Makefile.qt.include build: extract $(BOOST_CPPFLAGS) from $(BITCOIN_INCLUDES) 2022-09-13 17:15:17 +01:00
Makefile.qt_locale.include
Makefile.qttest.include build: extract $(BOOST_CPPFLAGS) from $(BITCOIN_INCLUDES) 2022-09-13 17:15:17 +01:00
Makefile.test.include Merge bitcoin/bitcoin#25789: test: clean and extend availablecoins_tests coverage 2023-01-03 12:52:40 -05:00
Makefile.test_fuzz.include [fuzz] Move ConsumeNetAddr to fuzz/util/net.h 2022-11-17 14:52:45 +00:00
Makefile.test_util.include refactor: unify test/util/wallet.h with wallet/test/util.h 2022-11-21 17:30:00 -03:00
Makefile.univalue.include
mapport.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
mapport.h
memusage.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
merkleblock.cpp
merkleblock.h
net.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
net.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
net_permissions.cpp
net_permissions.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
net_processing.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
net_processing.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
net_types.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
net_types.h
netaddress.cpp doc: net: fix link to onion address encoding scheme [ONIONADDRESS] 2023-01-10 14:23:27 +01:00
netaddress.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
netbase.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
netbase.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
netgroup.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
netgroup.h
netmessagemaker.h
noui.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
noui.h
outputtype.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
outputtype.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
pow.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
pow.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
prevector.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
protocol.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
protocol.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
psbt.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
psbt.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
pubkey.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
pubkey.h Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
random.cpp doc: remove usages of C++11 2023-01-12 13:42:44 +00:00
random.h doc: remove usages of C++11 2023-01-12 13:42:44 +00:00
randomenv.cpp doc: remove usages of C++11 2023-01-12 13:42:44 +00:00
randomenv.h
rest.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
rest.h
reverse_iterator.h doc: remove usages of C++11 2023-01-12 13:42:44 +00:00
scheduler.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
scheduler.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
serialize.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
shutdown.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
shutdown.h
signet.cpp
signet.h
span.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
streams.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
sync.cpp
sync.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
threadsafety.h
timedata.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
timedata.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
tinyformat.h clang-tidy: Fix modernize-use-nullptr in headers 2022-12-15 20:58:19 +00:00
torcontrol.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
torcontrol.h
txdb.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
txdb.h refactor: add kernel/cs_main.* 2023-01-05 09:05:14 +00:00
txmempool.cpp refactor: Work around Werror=free-nonheap-object in AssumeCalculateMemPoolAncestors 2023-01-05 19:48:14 +01:00
txmempool.h refactor: add kernel/cs_main.* 2023-01-05 09:05:14 +00:00
txorphanage.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
txorphanage.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
txrequest.cpp
txrequest.h
uint256.cpp
uint256.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
undo.h
validation.cpp Merge bitcoin/bitcoin#26251: refactor: add kernel/cs_main.h 2023-01-16 13:44:56 +01:00
validation.h Merge bitcoin/bitcoin#26251: refactor: add kernel/cs_main.h 2023-01-16 13:44:56 +01:00
validationinterface.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
validationinterface.h refactor: add kernel/cs_main.* 2023-01-05 09:05:14 +00:00
version.h
versionbits.cpp refactor: use braced init for integer constants instead of c style casts 2023-01-03 19:31:29 -06:00
versionbits.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
walletinitinterface.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
warnings.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
warnings.h