From 0e62de7b6bce37e01384b2f19a70eea331b3443d Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 10 Feb 2023 04:12:34 +0100 Subject: [PATCH] Don't complain so much about LXC failing to stop until we are at retry=3 --- lib/lxc.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/lxc.sh b/lib/lxc.sh index ff16929..c9321d3 100644 --- a/lib/lxc.sh +++ b/lib/lxc.sh @@ -144,7 +144,10 @@ LXC_STOP () { then break fi - log_warning "Failed to stop LXC (status=$status) ? Retrying in 10 sec ..." + if [[ ${retry_stop_lxc} -ge 3 ]] + then + log_warning "Failed to stop LXC (status=$status) ? Retrying in 10 sec ..." + fi retry_stop_lxc="$(($retry_stop_lxc+1))" sleep 10 timeout 30 lxc stop --timeout 15 $container_to_stop 2>/dev/null