mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Try to display service logs when hitting 50x errors
This commit is contained in:
parent
f4523d8e87
commit
faa67b38e2
1 changed files with 7 additions and 0 deletions
|
@ -246,6 +246,13 @@ Page extract:\n$page_extract" > $TEST_CONTEXT/curl_result
|
|||
[[ $curl_error -eq 0 ]] \
|
||||
&& log_debug "$(cat $TEST_CONTEXT/curl_result)" \
|
||||
|| log_warning "$(cat $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"
|
||||
fi
|
||||
done
|
||||
|
||||
# Detect the issue alias_traversal, https://github.com/yandex/gixy/blob/master/docs/en/plugins/aliastraversal.md
|
||||
|
|
Loading…
Add table
Reference in a new issue