install_amavis.sh: disable clamav-freshclam-once timer/service.

Since Debian 13 the package clamav-freshclam also ships and enables
clamav-freshclam-once.timer and clamav-freshclam-once.service. Together
with the freshclam daemon (clamav-freshclam.service) both try to lock
/var/log/clamav/freshclam.log at boot and one of them fails.

Disable the 'once' units right after stopping the daemon and before the
initial freshclam run, so only the daemon keeps the databases current.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrisandClaude Opus 5.5 committed 2026-11-22 01:47:20 +01:00
1 parent f0e6ff2506
commit 1278bfcfd0
1 file changed
+20
+20
View File
@@ -3082,6 +3082,26 @@ else
fi fi
fi fi
# - Since Debian 13 the package clamav-freshclam also ships (and enables)
# - clamav-freshclam-once.timer / clamav-freshclam-once.service. Together
# - with the freshclam daemon (clamav-freshclam.service) both try to lock
# - /var/log/clamav/freshclam.log at the same time and one of them fails.
# - Keep only the daemon.
# -
echononl " Disable clamav-freshclam-once (timer/service).."
if $systemd_exists && systemctl cat clamav-freshclam-once.service > /dev/null 2>&1 ; then
systemctl disable --now clamav-freshclam-once.timer clamav-freshclam-once.service > /dev/null 2> $tmp_err_msg
if [[ $? -eq 0 ]] ; then
systemctl reset-failed clamav-freshclam-once.service > /dev/null 2>&1
echo_ok
else
echo_failed
error "$(cat $tmp_err_msg)"
fi
else
echo_skipped
fi
echononl " Initial run of freshclam.." echononl " Initial run of freshclam.."
freshclam > /dev/null 2> $tmp_err_msg freshclam > /dev/null 2> $tmp_err_msg
if [[ $? -eq 0 ]] ; then if [[ $? -eq 0 ]] ; then