We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
why the folder /var/run/clamav will be deleted automatically after reboot?
-
- Posts: 301
- Joined: Tue Dec 22, 2015 2:06 pm
why the folder /var/run/clamav will be deleted automatically after reboot?
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?
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?
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: why the folder /var/run/clamav will be deleted automatically after reboot?
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?
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.
/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?
My fix:
Edit /lib/systemd/system/clamd.service
Added this lines:
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
Code: Select all
ExecStartPre = /usr/bin/mkdir -p /var/run/clamav
ExecStartPre = /usr/bin/chown -R clam.clam /var/run/clamav
-
- Posts: 301
- Joined: Tue Dec 22, 2015 2:06 pm
Re: why the folder /var/run/clamav will be deleted automatically after reboot?
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.
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?
Installed Vesta CP on 1.11.2016.
Same problem. Same solution.
Adding these strings halped me too. Thanks, AkGlo.
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?
Thank you AkGlo.
We implemented your solution (at least as temporary fix), it will be available in next release.
We implemented your solution (at least as temporary fix), it will be available in next release.