From 1278bfcfd0c20b9080125c3d194049b4e41649fc Mon Sep 17 00:00:00 2001 From: Christoph Date: Sun, 22 Nov 2026 01:47:20 +0100 Subject: [PATCH] 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 --- install_amavis.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/install_amavis.sh b/install_amavis.sh index 0202cd2..266cc53 100755 --- a/install_amavis.sh +++ b/install_amavis.sh @@ -3082,6 +3082,26 @@ else 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.." freshclam > /dev/null 2> $tmp_err_msg if [[ $? -eq 0 ]] ; then