CentOS: ClamAV update fails

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:


b) then set the permissions:

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

c) and then try to update manually once:


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


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.

The users and groups of ClamAV may even occasionally vary …just fixed CentOS v6.5 like that:

chown -R clamav:adm /var/log/clamav
chown -R clamav:adm /var/lib/clamav