From f9a528ab49ab2ed30327bf62279e3f9d67f1592a Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Mon, 10 Aug 2020 12:28:44 +0200 Subject: [PATCH] add new config properrty BITCOIND_SHUTDOWN_DELAY --- docker/my-dojo/conf/docker-bitcoind.conf.tpl | 13 ++++++++++++- docker/my-dojo/dojo.sh | 5 +++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docker/my-dojo/conf/docker-bitcoind.conf.tpl b/docker/my-dojo/conf/docker-bitcoind.conf.tpl index d1365eb..2695e14 100644 --- a/docker/my-dojo/conf/docker-bitcoind.conf.tpl +++ b/docker/my-dojo/conf/docker-bitcoind.conf.tpl @@ -104,4 +104,15 @@ BITCOIND_ZMQ_RAWTXS=9501 # Port exposing ZMQ notifications for block hashes # Set value to 9502 if BITCOIND_INSTALL is set to 'on' # Type: integer -BITCOIND_ZMQ_BLK_HASH=9502 \ No newline at end of file +BITCOIND_ZMQ_BLK_HASH=9502 + + +# +# SHUTDOWN +# + +# Max delay for bitcoind shutdown (expressed in seconds) +# Defines how long Dojo waits for a clean shutdown of bitcoind before shutting down the bitcoind container +# This parameter is inactive if BITCOIND_INSTALL is set to 'off' +# Type: integer +BITCOIND_SHUTDOWN_DELAY=180 \ No newline at end of file diff --git a/docker/my-dojo/dojo.sh b/docker/my-dojo/dojo.sh index 843d86b..6509d1d 100755 --- a/docker/my-dojo/dojo.sh +++ b/docker/my-dojo/dojo.sh @@ -96,7 +96,8 @@ stop() { # Check if the bitcoin daemon is still up # wait 3mn max i="0" - while [ $i -lt 18 ] + nbIters=$(( $BITCOIND_SHUTDOWN_DELAY / 10 )) + while [ $i -lt $nbIters ] do echo "Waiting for shutdown of Bitcoin server." # Check if bitcoind rpc api is responding @@ -115,7 +116,7 @@ stop() { done # Bitcoin daemon is still up # => force close - if [ $i -eq 18 ]; then + if [ $i -eq $nbIters ]; then echo "Force shutdown of Bitcoin server." fi fi