Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion RHEL/CentOS
  • Search

why the folder /var/run/clamav will be deleted automatically after reboot?

RHEL/CentOS related topics
Post Reply
  • Print view
Advanced search
7 posts • Page 1 of 1
baijianpeng
Posts: 301
Joined: Tue Dec 22, 2015 2:06 pm

why the folder /var/run/clamav will be deleted automatically after reboot?
  • Quote

Post by baijianpeng » Mon Mar 28, 2016 1:16 am

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?
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: why the folder /var/run/clamav will be deleted automatically after reboot?
  • Quote

Post by mehargags » Mon Mar 28, 2016 5:36 am

I usually keep Clam "OUT" from Starting automatically. its an unnecessary memory hog not needed on daily basis. You may consider the same.
Top

pandabb
Posts: 192
Joined: Sat Aug 08, 2015 3:03 am

Re: why the folder /var/run/clamav will be deleted automatically after reboot?
  • Quote

Post by pandabb » Mon Apr 11, 2016 2:33 pm

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.
Top

AkGlo
Posts: 1
Joined: Wed Apr 20, 2016 11:55 am

Re: why the folder /var/run/clamav will be deleted automatically after reboot?
  • Quote

Post by AkGlo » Wed Apr 20, 2016 11:57 am

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
Top

baijianpeng
Posts: 301
Joined: Tue Dec 22, 2015 2:06 pm

Re: why the folder /var/run/clamav will be deleted automatically after reboot?
  • Quote

Post by baijianpeng » Wed Apr 20, 2016 12:20 pm

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.
Top

Sattva
Posts: 71
Joined: Thu Apr 25, 2013 9:34 am

Re: why the folder /var/run/clamav will be deleted automatically after reboot?
  • Quote

Post by Sattva » Thu Nov 10, 2016 3:03 pm

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
Top

dpeca
VestaCP Team
Posts: 473
Joined: Wed Nov 25, 2015 7:30 pm

Re: why the folder /var/run/clamav will be deleted automatically after reboot?
  • Quote

Post by dpeca » Fri Nov 11, 2016 5:48 pm

Thank you AkGlo.
We implemented your solution (at least as temporary fix), it will be available in next release.
Top


Post Reply
  • Print view

7 posts • Page 1 of 1

Return to “RHEL/CentOS”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

cron

Login  •  Register

I forgot my password