Page 1 of 1
why the folder /var/run/clamav will be deleted automatically after reboot?
Posted: Mon Mar 28, 2016 1:16 am
by baijianpeng
It was already confirmed as a bug that
clamav will cause high CPU usage, the solution is to manually create a new folder named "clamav" under "/var/run", and then change the ownership of this "clamav" folder to "clam:mail" or any other than "root:root".
Well, I also encountered this issue on my VestaCP on CentOS7. So I did this: manually created a new folder "/var/run/clamav" and chown it to "clam:mail".
But, each time if I reboot my server (due to some performance issue), I noticed that this folder "/var/run/clamav" will be deleted automatically! I have to manually create it again!
Why?
Why the installation script of VestaCP has NOT solved this "high CPU usage" issue yet?
Re: why the folder /var/run/clamav will be deleted automatically after reboot?
Posted: Mon Mar 28, 2016 5:36 am
by mehargags
I usually keep Clam "OUT" from Starting automatically. its an unnecessary memory hog not needed on daily basis. You may consider the same.
Re: why the folder /var/run/clamav will be deleted automatically after reboot?
Posted: Mon Apr 11, 2016 2:33 pm
by pandabb
Try to change the path where it create sock and etc.
/etc/clamd.conf instead of var/run change path to var/log/clamav works fine to me.
Re: why the folder /var/run/clamav will be deleted automatically after reboot?
Posted: Wed Apr 20, 2016 11:57 am
by AkGlo
My fix:
Edit /lib/systemd/system/clamd.service
Code: Select all
[Unit]
Description = clamd scanner (clamd) daemon
After = syslog.target nss-lookup.target network.target
[Service]
Type = simple
ExecStartPre = /usr/bin/mkdir -p /var/run/clamav
ExecStartPre = /usr/bin/chown -R clam.clam /var/run/clamav
ExecStart = /usr/sbin/clamd -c /etc/clamd.conf --nofork=yes
Restart = on-failure
PrivateTmp = true
[Install]
WantedBy=multi-user.target
Added this lines:
Code: Select all
ExecStartPre = /usr/bin/mkdir -p /var/run/clamav
ExecStartPre = /usr/bin/chown -R clam.clam /var/run/clamav
Re: why the folder /var/run/clamav will be deleted automatically after reboot?
Posted: Wed Apr 20, 2016 12:20 pm
by baijianpeng
hi AkGlo , your trick works.
However, it seems that each time when the server reboot, it will re-create that folder and assign proper ownership to it. Because when I testing with your code, I run the command "top" immediately after reboot, it shows that the CPU usage is very high (99%) at that moment, several seconds later, it decreased to very low number.
Anyway, it is better than creating that folder manually.
Thank you.
Re: why the folder /var/run/clamav will be deleted automatically after reboot?
Posted: Thu Nov 10, 2016 3:03 pm
by Sattva
Installed Vesta CP on 1.11.2016.
Same problem. Same solution.
Adding these strings halped me too. Thanks,
AkGlo.
Code: Select all
ExecStartPre = /usr/bin/mkdir -p /var/run/clamav
ExecStartPre = /usr/bin/chown -R clam.clam /var/run/clamav
Code: Select all
[root@savitur system]# cat clamd.service
[Unit]
Description = clamd scanner (clamd) daemon
After = syslog.target nss-lookup.target network.target
[Service]
Type = simple
ExecStartPre = /usr/bin/mkdir -p /var/run/clamav
ExecStartPre = /usr/bin/chown -R clam.clam /var/run/clamav
ExecStart = /usr/sbin/clamd -c /etc/clamd.conf
Restart = on-failure
PrivateTmp = true
[Install]
WantedBy=multi-user.target
Re: why the folder /var/run/clamav will be deleted automatically after reboot?
Posted: Fri Nov 11, 2016 5:48 pm
by dpeca
Thank you AkGlo.
We implemented your solution (at least as temporary fix), it will be available in next release.