freshclam needs /var/log/clamav/freshclam.log
Description:
On fresh installation of clamav and enabling clamav-freshclam.service it fails with error about /var/log/clamav/freshclam.log file
Feb 03 10:26:19 foo systemd[1]: Started ClamAV virus database updater.
Feb 03 10:26:19 foo freshclam[4287]: ERROR: lchown to user 'clamav' failed on
Feb 03 10:26:19 foo freshclam[4287]: log file '/var/log/clamav/freshclam.log'.
Feb 03 10:26:19 foo freshclam[4287]: Error was 'No such file or directory'
Feb 03 10:26:19 foo freshclam[4287]: WARNING: lchown to user 'clamav' failed on log file '/var/log/clamav/freshclam.log'. Error was 'No such file or directory'
Feb 03 10:26:19 foo freshclam[4287]: ERROR: Failed to switch to clamav user.
Feb 03 10:26:19 foo systemd[1]: clamav-freshclam.service: Main process exited, code=exited, status=9/n/a
Feb 03 10:26:19 foo systemd[1]: clamav-freshclam.service: Failed with result 'exit-code'.
Solution is to add following line in /usr/lib/tmpfiles.d/clamav.conf (clamav.tmpfiles in source package)
f /var/log/clamav/freshclam.log 0600 clamav clamav
Additional info:
-
package version(s):
1.4.1-1 (may be earlier versions too)
-
config and/or log files:
/usr/lib/tmpfiles.d/clamav.conf
/var/log/clamav/freshclam.log
-
link to upstream bug report, if any:
N/A - See solution above.
Steps to reproduce:
- systemctl stop clamav-freshclam.service
- rm /var/log/clamav/freshclam.log
- systemctl start clamav-freshclam.service
- systemctl status clamav-freshclam.service