From 964d95966c26e7f6728c8986eaa492a8763a451b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 7 Feb 2023 02:12:25 +0100 Subject: [PATCH] Try to add some --debug during lxc restore snapshot to understand what the fucking hell is 'in use' T_T --- lib/lxc.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/lxc.sh b/lib/lxc.sh index 7dead88..4a13a99 100644 --- a/lib/lxc.sh +++ b/lib/lxc.sh @@ -86,10 +86,15 @@ LOAD_LXC_SNAPSHOT () { CLEAN_SWAPFILES local retry_lxc=0 + local debug="" while [[ ${retry_lxc} -lt 10 ]] do LXC_STOP $LXC_NAME || true - lxc restore $LXC_NAME $snapname && break || retry_lxc=$(($retry_lxc+1)) + if [[ ${retry_lxc} -ge 2 ]] + then + debug="--debug" + fi + lxc restore $LXC_NAME $snapname $debug && break || retry_lxc=$(($retry_lxc+1)) log_warning "Failed to restore snapshot? Retrying in 20 sec ..." sleep 20 done