CentOS: ClamAV update fails
April 8th, 2014

In case your ClamAV stopped it’s daily update via cronjob and the Anacronist complains:

ERROR: Can't open /var/log/clamav/freshclam.log in append mode (check permissions!).
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).

This is because the system-user which ClamAV uses may have changed due to an update.
This issue can be easily fixed, when knowing which user/group needs to be set.

a) open a terminal and obtain root permissions:

su
password:

b) then set the permissions:

chown clam:clam /var/log/clamav/freshclam.log

c) and then try to update manually one:

/etc/cron.daily/freshclam

d) in case ClamAV updated properly, one can drop root permissions again:

exit

Theoretically it could be the other way around as well: that user/group changed from clam to clamav. I’ve just checked once: my server still has both users, while I’d guess I could even remove clamav. The reason for this strange behavior seems to be, that not all repositories have builds which are compiled utilizing the same user/group.