The service ‘freshclam’ on server is currently down (Debian 8)



If You are getting mails from DA about:

The service 'freshclam' on server is currently down

And status after freshclam restart:

# service freshclam status
● freshclam.service - ClamAV updater daemon
   Loaded: loaded (/etc/systemd/system/freshclam.service; enabled)
   Active: failed (Result: timeout) since Wed 2016-01-06 08:29:31 CET; 2s ago
  Process: 13369 ExecStart=/usr/local/bin/freshclam -d (code=exited, status=0/SUCCESS)

Jan 06 08:28:01 freshclam[13370]: freshclam daemon 0.99 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
Jan 06 08:28:01 freshclam[13370]: ClamAV update process started at Wed Jan  6 08:28:01 2016
Jan 06 08:28:01 freshclam[13370]: main.cvd is up to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
Jan 06 08:28:01 freshclam[13370]: daily.cld is up to date (version: 21229, sigs: 1786793, f-level: 63, builder: neo)
Jan 06 08:28:01 freshclam[13370]: bytecode.cvd is up to date (version: 270, sigs: 46, f-level: 63, builder: shurley)
Jan 06 08:28:01 freshclam[13370]: --------------------------------------
Jan 06 08:29:31 systemd[1]: freshclam.service start operation timed out. Terminating.
Jan 06 08:29:31 freshclam[13370]: Update process terminated
Jan 06 08:29:31 systemd[1]: Failed to start ClamAV updater daemon.
Jan 06 08:29:31 systemd[1]: Unit freshclam.service entered failed state.

It’s because service waits for a pid to appear in /var/run/clamd, but directory doesn’t exist, and it has insufficient permissions to create it.

Solution is to create that dir with correct permissions:

killall freshclam
mkdir -p /var/run/clamd
chown root:clamav /var/run/clamd
chmod -R 775 /var/run/clamd
systemctl start freshclam


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.