You are not logged in.

#1 2024-01-26 01:44:14

jomo_G
Member
From: Edmonton
Registered: 2023-11-07
Posts: 12

[Solved]clamav-freshclam.service failed to start

Hello, hope you are doing well. when I checked my systemctl log today, I found my clamav-freshclam.service failed to start. I've tried this wiki page and this one.

To give you a bit of context, these are my output for

systemctl status clamav-freshclam.service
clamav-freshclam.service - ClamAV virus database updater
     Loaded: loaded (/usr/lib/systemd/system/clamav-freshclam.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Thu 2024-01-25 18:26:22 MST; 11min ago
   Duration: 11ms
       Docs: man:freshclam(1)
             man:freshclam.conf(5)
             https://docs.clamav.net/
    Process: 3223 ExecStart=/usr/bin/freshclam -d --foreground=true (code=exited, status=9)
   Main PID: 3223 (code=exited, status=9)
        CPU: 11ms

Jan 25 18:26:22 jarchie systemd[1]: Started ClamAV virus database updater.
Jan 25 18:26:22 jarchie freshclam[3223]: ERROR: lchown to user 'clamav' failed on
Jan 25 18:26:22 jarchie freshclam[3223]: log file '/var/log/clamav/freshclam.log'.
Jan 25 18:26:22 jarchie freshclam[3223]: Error was 'No such file or directory'
Jan 25 18:26:22 jarchie freshclam[3223]: WARNING: lchown to user 'clamav' failed on log file '/var/log/clamav/freshclam.log'.  Error was 'No such file or directory'
Jan 25 18:26:22 jarchie freshclam[3223]: ERROR: Failed to switch to clamav user.
Jan 25 18:26:22 jarchie systemd[1]: clamav-freshclam.service: Main process exited, code=exited, status=9/n/a
Jan 25 18:26:22 jarchie systemd[1]: clamav-freshclam.service: Failed with result 'exit-code'.

It seemed to me that the freshclam.log was missing. So I went into the

/var/log/clamav

Here are the files in this folder.

.  ..  clamd.log

Thank you in advance if you could help me

Last edited by jomo_G (2024-01-26 04:02:43)

Offline

#2 2024-01-26 02:15:46

jomo_G
Member
From: Edmonton
Registered: 2023-11-07
Posts: 12

Re: [Solved]clamav-freshclam.service failed to start

Issue resolved!

Solution: I went into

/var/log/clamav

and created an empty file named "freshclam.log"

Last edited by jomo_G (2024-01-26 02:16:18)

Offline

#3 2024-03-22 12:38:14

mitvix
Member
Registered: 2015-11-09
Posts: 2

Re: [Solved]clamav-freshclam.service failed to start

Thank you Edmonton,
Your answer is perfectly right.
Essentially it's necessary to create freshclam.log and chown to clamav:clamav

sudo touch /var/log/clamav/freshclam.log && chown clamav:clamav

thank you

Last edited by mitvix (2024-03-22 12:39:06)

Offline

Board footer

Powered by FluxBB