Getting ClamAV Daemon working in Ubuntu 18.04

Re: Getting ClamAV Daemon working in Ubuntu 18.04

by Renan Piazza do Prado -
Number of replies: 3

Probably late, but i just fixed this issue on my server (debian), the clamav-daemon.service file need to have JoinsNamespaceOf=apache2.service on the [Unit] and PrivateTmp=true on the [Service] , like this:

[Unit]
...
JoinsNamespaceOf=apache2.service
[Service]
...
PrivateTmp=true
The apache2 file just need to have the PrivateTmp=true. Do a  systemd daemon-reload after editing the systemd files and restart the clamav-daemon.



Average of ratings: Useful (1)
In reply to Renan Piazza do Prado

Re: Getting ClamAV Daemon working in Ubuntu 18.04

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Thank you for your contribution. Not too late I'm afraid. Still not working (on Ubuntu 18.04)
I followed your suggestion and had most of the settings already. I just needed to add PrivateTmp=true in the [Service]-section from /etc/systemd/system/multi-user.target.wants/clamav-daemon.service

Reloading the systemd daemon on Ubuntu is with systemctl daemon-reload

But I still get the same reading error on /tmp when using the daemon in stead of command line. Command line performance is awfull.
In reply to koen roggemans

Re: Getting ClamAV Daemon working in Ubuntu 18.04

by erotavlas erotavlas -
Hi,
I upgraded to php-7.4 via PPA and my problem with clamAV is gone. Moreover, even performance seems better.
In reply to Renan Piazza do Prado

Re: Getting ClamAV Daemon working in Ubuntu 20.04

by heli g -
Thank you so much for this. It solved the issue for me on Ubuntu 20.04. Repeating for posterity:

Edit the clamav start up file
sudo nano  /etc/systemd/system/multi-user.target.wants/clamav-daemon.service

Add to the end of the correct sections

[Unit]
...
JoinsNamespaceOf=apache2.service

[Service]
...
PrivateTmp=true

Restart services

sudo systemctl daemon-reload
sudo systemctl restart clamav-daemon.service