[ClamAV] Try to prevent update collisions

This commit is contained in:
andryyy 2019-10-22 13:50:03 +02:00
parent be4099182b
commit 1e4aa212ea
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
2 changed files with 9 additions and 6 deletions

View File

@ -40,16 +40,15 @@ BACKGROUND_TASKS=()
( (
while true; do while true; do
sleep 1m
freshclam freshclam
sleep 1h sleep 12600
done done
) & ) &
BACKGROUND_TASKS+=($!) BACKGROUND_TASKS+=($!)
( (
while true; do while true; do
sleep 2m sleep 10m
SANE_MIRRORS="$(dig +ignore +short rsync.sanesecurity.net)" SANE_MIRRORS="$(dig +ignore +short rsync.sanesecurity.net)"
for sane_mirror in ${SANE_MIRRORS}; do for sane_mirror in ${SANE_MIRRORS}; do
CE= CE=
@ -69,11 +68,15 @@ while true; do
CE=$? CE=$?
chmod 755 /var/lib/clamav/ chmod 755 /var/lib/clamav/
if [ ${CE} -eq 0 ]; then 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 break
fi fi
done done
sleep 30h sleep 12h
done done
) & ) &
BACKGROUND_TASKS+=($!) BACKGROUND_TASKS+=($!)

View File

@ -52,7 +52,7 @@ services:
- redis - redis
clamd-mailcow: clamd-mailcow:
image: mailcow/clamd:1.30 image: mailcow/clamd:1.31
build: ./data/Dockerfiles/clamd build: ./data/Dockerfiles/clamd
restart: always restart: always
dns: dns: