Browse Source

Merge branch 'feat_mydojo_bitcoind_shutdown' into 'develop'

add new config properrty BITCOIND_SHUTDOWN_DELAY

See merge request dojo/samourai-dojo!157
use-env-var-docker
kenshin-samourai 4 years ago
parent
commit
d4c32d33ca
  1. 13
      docker/my-dojo/conf/docker-bitcoind.conf.tpl
  2. 5
      docker/my-dojo/dojo.sh

13
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
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

5
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

Loading…
Cancel
Save