From 90147c25c9c84590130e8c75364e9db7ee3f55e3 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 10 Feb 2023 18:03:51 +0100 Subject: [PATCH] Try to add stupid sleep to mitigate issue where 'lxc exec' is stuck for no reason -_- --- lib/lxc.sh | 4 +++- lib/witness.sh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/lxc.sh b/lib/lxc.sh index 87cbc4f..c8ddbca 100644 --- a/lib/lxc.sh +++ b/lib/lxc.sh @@ -36,7 +36,7 @@ LXC_CREATE () { [[ "$pipestatus" -eq 0 ]] || exit 1 _LXC_START_AND_WAIT $LXC_NAME - sleep 10 + sleep 3 set_witness_files sleep 3 log_info "Creating initial snapshot $LXC_NAME ..." @@ -237,6 +237,8 @@ _LXC_START_AND_WAIT() { fi done + sleep 3 + LXC_IP=$(lxc exec $1 -- hostname -I | cut -d' ' -f1 | grep -E -o "\<[0-9.]{8,}\>") } diff --git a/lib/witness.sh b/lib/witness.sh index 78b3e30..e2ee316 100644 --- a/lib/witness.sh +++ b/lib/witness.sh @@ -52,6 +52,8 @@ check_witness_files () { fi } + sleep 2 + # Nginx conf check_file_exist "/etc/nginx/conf.d/$DOMAIN.d/witnessfile.conf" check_file_exist "/etc/nginx/conf.d/$SUBDOMAIN.d/witnessfile.conf"