[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
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+=($!)

View File

@ -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: