From 08aa2eece3b22e9363e2325975238610b15a3617 Mon Sep 17 00:00:00 2001 From: Simon L Date: Fri, 16 Dec 2022 12:36:51 +0100 Subject: [PATCH 1/2] fix Clamav starting trap Signed-off-by: Simon L --- Containers/nextcloud/entrypoint.sh | 8 +++++++- php/templates/containers.twig | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index 37abacc2..ac1c285e 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -463,10 +463,16 @@ fi # Clamav if [ "$CLAMAV_ENABLED" = 'yes' ]; then - while ! nc -z "$CLAMAV_HOST" 3310; do + CLAMAV_COUNT=0 + while ! nc -z "$CLAMAV_HOST" 3310 && [ "$CLAMAV_COUNT" -lt 90 ]; do echo "waiting for clamav to become available..." + CLAMAV_COUNT=$((CLAMAV_COUNT + 5)) sleep 5 done + if [ "$CLAMAV_COUNT" -ge 90 ]; then + echo "Error: ClamAV was not reachable within 90s." + exit 1 + fi if ! [ -d "/var/www/html/custom_apps/files_antivirus" ]; then php /var/www/html/occ app:install files_antivirus elif [ "$(php /var/www/html/occ config:app:get files_antivirus enabled)" = "no" ]; then diff --git a/php/templates/containers.twig b/php/templates/containers.twig index c31d2f1b..0f642d33 100644 --- a/php/templates/containers.twig +++ b/php/templates/containers.twig @@ -562,7 +562,7 @@ {% endif %} {% endif %} - {% if isApacheStarting == true or is_backup_container_running == true or isWatchtowerRunning == true or is_daily_backup_running == true %} + {% if isAnyRestarting == false and (isApacheStarting == true or is_backup_container_running == true or isWatchtowerRunning == true or is_daily_backup_running == true) %} {% else %} From 1bd3c2cb4c569f99db4e12cc159dbc731a95e795 Mon Sep 17 00:00:00 2001 From: Simon L Date: Fri, 16 Dec 2022 18:12:03 +0100 Subject: [PATCH 2/2] add a further hint Signed-off-by: Simon L --- Containers/nextcloud/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index ac1c285e..c9ae6884 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -470,7 +470,7 @@ if [ "$CLAMAV_ENABLED" = 'yes' ]; then sleep 5 done if [ "$CLAMAV_COUNT" -ge 90 ]; then - echo "Error: ClamAV was not reachable within 90s." + echo "Error: ClamAV was not reachable within 90s. Most likely is your RAM not big enough to let it start correctly." exit 1 fi if ! [ -d "/var/www/html/custom_apps/files_antivirus" ]; then