Skip to content

Fix failure of freshclam w/o freshclam.log file

Amish M requested to merge amishmm/clamav:main into main

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

Edited by Amish M

Merge request reports

Loading