From ef10a6ed9301456ead633bb2fc7721c2371be1ab Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Sat, 12 Aug 2023 13:54:12 +0200 Subject: [PATCH] synapse.. 10_install --- podman-matrix/10_install.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/podman-matrix/10_install.sh b/podman-matrix/10_install.sh index ffde943..41877a9 100755 --- a/podman-matrix/10_install.sh +++ b/podman-matrix/10_install.sh @@ -43,20 +43,22 @@ podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --sha end=$((SECONDS+120)) while [ $SECONDS -lt $end ]; do sleep 1 - if check_container_running synapse; then - podman logs synapse 2>&1 | grep -qe 'Preparing for databases' && + if check_container_running ${container_name}; then + podman logs ${container_name} 2>&1 | grep -qe 'Preparing for databases' && break else - podman logs synapse 2>&1 | grep -qe 'psycopg2.OperationalError: could not connect to server: Connection refused' && - podman healthcheck run synapse-db && + podman logs ${container_name} 2>&1 | grep -qe 'psycopg2.OperationalError: could not connect to server: Connection refused' && + podman healthcheck run ${db_container_name} && echo "Oops, synapse didn't wait for PostgreSQL, restarting" - podman start synapse + podman start ${container_name} fi done && +podman container wait --condition=running ${container_name} && echo -n "Waiting for background tasks to end... " && -( podman container logs --tail=10 -f ${container_name} 2>&1 & ) | grep -q 'No more background updates to do' && -echo "OK." && +( podman container logs --tail=50 -f ${container_name} 2>&1 & ) | grep -q 'No more background updates to do' && +echo "OK." || retval=false podman pod stop ${pod_name} && -echo "Done. Pod built and stopped." +echo "Done. Pod stopped." shred -u .env +eval "$retval"