From 473da583d2aeb1bf4e71ca887f4bfbfb6ddcf9cd Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 9 Mar 2021 14:23:45 +0100 Subject: [PATCH] Can't have pipe in LXC_EXEC commands --- lib/tests.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/tests.sh b/lib/tests.sh index d872382..fba5cf8 100644 --- a/lib/tests.sh +++ b/lib/tests.sh @@ -250,8 +250,11 @@ Page extract:\n$page_extract" > $TEST_CONTEXT/curl_result # If we had a 50x error, try to display service info and logs to help debugging if [[ $curl_error -ne 0 ]] && echo "5" | grep -q "${http_code:0:1}" then - LXC_EXEC "systemctl | grep '$app.*service'" - LXC_EXEC "for SERVICE in $(systemctl | grep "$app.*service" | awk '{print $1}'); do journalctl --no-pager --no-hostname -n 30 -u $SERVICE; done" + LXC_EXEC "systemctl" | grep "$app_id_to_check.*service" + for SERVICE in LXC_EXEC "systemctl" | grep "$app_id_to_check.*service" | awk '{print $1}' + do + LXC_EXEC "journalctl --no-pager --no-hostname -n 30 -u $SERVICE"; + done fi done