From 1e4aa212ea3e85930d5e8b90a117d95315337295 Mon Sep 17 00:00:00 2001 From: andryyy Date: Tue, 22 Oct 2019 13:50:03 +0200 Subject: [PATCH] [ClamAV] Try to prevent update collisions --- data/Dockerfiles/clamd/clamd.sh | 13 ++++++++----- docker-compose.yml | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/data/Dockerfiles/clamd/clamd.sh b/data/Dockerfiles/clamd/clamd.sh index 20153659..a8ceb5f6 100755 --- a/data/Dockerfiles/clamd/clamd.sh +++ b/data/Dockerfiles/clamd/clamd.sh @@ -40,16 +40,15 @@ BACKGROUND_TASKS=() ( while true; do - sleep 1m freshclam - sleep 1h + sleep 12600 done ) & BACKGROUND_TASKS+=($!) ( while true; do - sleep 2m + sleep 10m SANE_MIRRORS="$(dig +ignore +short rsync.sanesecurity.net)" for sane_mirror in ${SANE_MIRRORS}; do CE= @@ -69,11 +68,15 @@ while true; do CE=$? chmod 755 /var/lib/clamav/ if [ ${CE} -eq 0 ]; then - echo RELOAD | nc localhost 3310 + while [ ! -z "$(pidof freshclam)" ]; do + echo "Freshclam is active, waiting..." + sleep 5 + done + echo RELOAD | nc clamd-mailcow 3310 break fi done - sleep 30h + sleep 12h done ) & BACKGROUND_TASKS+=($!) diff --git a/docker-compose.yml b/docker-compose.yml index a459a763..3eee7857 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,7 +52,7 @@ services: - redis clamd-mailcow: - image: mailcow/clamd:1.30 + image: mailcow/clamd:1.31 build: ./data/Dockerfiles/clamd restart: always dns: