Change Dojo restart policy; More Dojo re-install tweaks

This commit is contained in:
Taylor Helsper 2020-04-11 14:43:23 -05:00
parent 92d8162110
commit 025a35a9e2
5 changed files with 18 additions and 4 deletions

View File

@ -96,9 +96,9 @@ while true; do
# Run Dojo Install or Upgrade
cd /opt/mynode/dojo/docker/my-dojo
if [ "$INSTALL" = "true" ]; then
echo 'y' | sudo ./dojo.sh install &
yes | sudo ./dojo.sh install &
else
echo 'y' | sudo ./dojo.sh upgrade &
yes | sudo ./dojo.sh upgrade &
fi
#Check for install/upgrade to finish to initialize Dojo mysql db

View File

@ -80,6 +80,9 @@ BITCOIND_ZMQ_BLK_HASH=28334
# Turn off explorer for MyNode
sed -i 's|EXPLORER_INSTALL=on|EXPLORER_INSTALL=off|' /opt/mynode/dojo/docker/my-dojo/conf/docker-explorer.conf.tpl
# Enable electrs
sed -i 's|INDEXER_IP=.*|INDEXER_IP=172.28.0.1|' /opt/mynode/dojo/docker/my-dojo/conf/docker-indexer.conf.tpl
# check if configuration files have been previously created and skip if yes
if [ -f /opt/mynode/dojo/docker/my-dojo/conf/docker-node.conf ]; then
echo "File present - skip docker-node.conf"
@ -127,3 +130,6 @@ if [ $IS_ROCK64 = 1 ] || [ $IS_ROCKPRO64 = 1 ]; then
sed -i 's|ENV GOLANG_ARCHIVE.*|ENV GOLANG_ARCHIVE go1.13.6.linux-arm64.tar.gz|' /opt/mynode/dojo/docker/my-dojo/tor/Dockerfile
sed -i 's|ENV GOLANG_SHA256.*|ENV GOLANG_SHA256 0a18125c4ed80f9c3045cf92384670907c4796b43ed63c4307210fe93e5bbca5|' /opt/mynode/dojo/docker/my-dojo/tor/Dockerfile
fi
# Modify restart policy
sed -i 's|restart:.*|restart: on-failure|' /opt/mynode/dojo/docker/my-dojo/docker-compose.yaml

View File

@ -2,6 +2,8 @@
set -e
source /usr/share/mynode/mynode_config.sh
sleep 30s #dojo needs time to start before passing next line
# initalize mysql db (REQUIRED TO START MYSQL)
@ -20,7 +22,9 @@ do
isRunning=$(docker inspect --format="{{.State.Running}}" db)
if [ "$isRunning" == "true" ]; then
sleep 60s
if [ $IS_RASPI = 1 ]; then
docker exec -i db bash -c "mysql -h db -u root -p$MYSQL_ROOT_PASSWORD $MYSQL_DATABASE" </opt/mynode/dojo/db-scripts/1_db.sql
fi
echo "dojo mysql db initalized"
sleep 5s
# Stop dojo after install/update and initalization is complete

View File

@ -12,6 +12,10 @@ systemctl stop dojo
systemctl stop btcpayserver
# Manually stop services (backup)
/opt/mynode/dojo/docker/my-dojo/dojo.sh stop || true
# Stop core services
systemctl stop electrs
systemctl stop lnd

View File

@ -8,7 +8,7 @@ sleep 10s
# Check if
echo "Checking if docker images have been installed..."
while [ -f /tmp/installing_docker_images ]; do
sleep 10s
sleep 30s
done
exit 0