Merge pull request #134 from selfhoster1312/no-pager

Don't let systemctl open a pager to list units...
This commit is contained in:
Alexandre Aubin 2023-01-11 01:22:41 +01:00 committed by GitHub
commit 03f9f66db0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -284,8 +284,8 @@ 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 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}" if [[ $curl_error -ne 0 ]] && echo "5" | grep -q "${http_code:0:1}"
then then
LXC_EXEC "systemctl --all" | grep "$app_id_to_check.*service" LXC_EXEC "systemctl --no-pager --all" | grep "$app_id_to_check.*service"
for SERVICE in $(LXC_EXEC "systemctl -all" | grep -o "$app_id_to_check.*service") for SERVICE in $(LXC_EXEC "systemctl --no-pager -all" | grep -o "$app_id_to_check.*service")
do do
LXC_EXEC "journalctl --no-pager --no-hostname -n 30 -u $SERVICE"; LXC_EXEC "journalctl --no-pager --no-hostname -n 30 -u $SERVICE";
done done