From fbf3b99d04f7912448aabf30004fbabd94fa41a9 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 17 Jan 2020 11:13:36 +0100 Subject: [PATCH 1/5] bump versions of dojo and bitcoind container --- docker/my-dojo/.env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/my-dojo/.env b/docker/my-dojo/.env index a301808..c02a936 100644 --- a/docker/my-dojo/.env +++ b/docker/my-dojo/.env @@ -10,9 +10,9 @@ COMPOSE_CONVERT_WINDOWS_PATHS=1 -DOJO_VERSION_TAG=1.4.0 +DOJO_VERSION_TAG=1.4.1 DOJO_DB_VERSION_TAG=1.1.0 -DOJO_BITCOIND_VERSION_TAG=1.4.0 +DOJO_BITCOIND_VERSION_TAG=1.4.1 DOJO_NODEJS_VERSION_TAG=1.4.0 DOJO_NGINX_VERSION_TAG=1.4.0 DOJO_TOR_VERSION_TAG=1.3.0 From c451eb02f05ae2dfb15e962f05f785eaf6d0523e Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 17 Jan 2020 11:14:43 +0100 Subject: [PATCH 2/5] add trace in stop() function of dojo.sh --- docker/my-dojo/dojo.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/my-dojo/dojo.sh b/docker/my-dojo/dojo.sh index 089cd93..ecf7657 100755 --- a/docker/my-dojo/dojo.sh +++ b/docker/my-dojo/dojo.sh @@ -87,6 +87,7 @@ stop() { i="0" while [ $i -lt 18 ] do + echo "Waiting for shutdown of Bitcoin server." # Check if bitcoind rpc api is responding timeout 5 docker exec -it bitcoind bitcoin-cli \ -rpcconnect=bitcoind \ From fa009582848359077248fa4fa725b0e82eecbf6c Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 17 Jan 2020 11:15:58 +0100 Subject: [PATCH 3/5] keep bitcoind container up if bitcoind exits with an error --- docker/my-dojo/bitcoin/restart.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/docker/my-dojo/bitcoin/restart.sh b/docker/my-dojo/bitcoin/restart.sh index b01a7ac..3294c28 100644 --- a/docker/my-dojo/bitcoin/restart.sh +++ b/docker/my-dojo/bitcoin/restart.sh @@ -40,13 +40,10 @@ if [ "$COMMON_BTC_NETWORK" == "testnet" ]; then fi bitcoind "${bitcoind_options[@]}" -exitCode=$? -if [ $exitCode -eq 0 ]; then - # Loop keeping the container up - # after bitcoind has been stopped - while true - do - tail -f /dev/null > /dev/null - done -fi +# Loop keeping the container up +# after bitcoind has been stopped +while true +do + tail -f /dev/null > /dev/null +done From 9af61f76229fced1739fe677cc9ba1c06dd2b8d2 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 17 Jan 2020 11:19:57 +0100 Subject: [PATCH 4/5] fix for dojo hanging on shutdown (force kill of "docker exec" used for testing bitcoind shutdown if command hangs more than 12s) --- docker/my-dojo/bitcoin/restart.sh | 5 ++--- docker/my-dojo/dojo.sh | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docker/my-dojo/bitcoin/restart.sh b/docker/my-dojo/bitcoin/restart.sh index 3294c28..be88d8a 100644 --- a/docker/my-dojo/bitcoin/restart.sh +++ b/docker/my-dojo/bitcoin/restart.sh @@ -41,9 +41,8 @@ fi bitcoind "${bitcoind_options[@]}" -# Loop keeping the container up -# after bitcoind has been stopped +# Keep the container up while true do - tail -f /dev/null > /dev/null + sleep 1 done diff --git a/docker/my-dojo/dojo.sh b/docker/my-dojo/dojo.sh index ecf7657..9331981 100755 --- a/docker/my-dojo/dojo.sh +++ b/docker/my-dojo/dojo.sh @@ -89,7 +89,7 @@ stop() { do echo "Waiting for shutdown of Bitcoin server." # Check if bitcoind rpc api is responding - timeout 5 docker exec -it bitcoind bitcoin-cli \ + timeout -k 12 10 docker exec -it bitcoind bitcoin-cli \ -rpcconnect=bitcoind \ --rpcport=28256 \ --rpcuser="$BITCOIND_RPC_USER" \ @@ -100,8 +100,6 @@ stop() { echo "Bitcoin server stopped." break fi - # Pause before next try - sleep 5 i=$[$i+1] done # Bitcoin daemon is still up From 3c70f892dc91b98ed09dfd3708e76810f2e77e5c Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 17 Jan 2020 12:02:06 +0100 Subject: [PATCH 5/5] bump mydojo version to 1.5.0 --- docker/my-dojo/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/my-dojo/.env b/docker/my-dojo/.env index c02a936..02530e8 100644 --- a/docker/my-dojo/.env +++ b/docker/my-dojo/.env @@ -10,7 +10,7 @@ COMPOSE_CONVERT_WINDOWS_PATHS=1 -DOJO_VERSION_TAG=1.4.1 +DOJO_VERSION_TAG=1.5.0 DOJO_DB_VERSION_TAG=1.1.0 DOJO_BITCOIND_VERSION_TAG=1.4.1 DOJO_NODEJS_VERSION_TAG=1.4.0