HELP: clamav causing cpu overload

casey

Well-Known Member
Jan 17, 2003
2,288
0
191
Originally posted by chirpy
In fact, it does appear that with a normal upgrade install of clamav it does install into /usr/local/* instead of /usr/*, so you might want to (be v.careful!):
Code:
rm /usr/lib/*clamav*
rm -R /usr/share/clamav/
rm /usr/include/clamav.h
(you can always re-install clamav if this causes any problems)
That was exactly the problem. Thanks, chirpy. Installing it with the cpanel installer doesn't work, but a simple ./configure;make;make install does work. Yippee! :)
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
:D :cool:

Just for those following this thread in the future, what exactly were the steps you took to remedy this? Did you remove the duplicate libraries?
 

casey

Well-Known Member
Jan 17, 2003
2,288
0
191
Originally posted by chirpy
:D :cool:

Just for those following this thread in the future, what exactly were the steps you took to remedy this? Did you remove the duplicate libraries?
Exact steps:

1) cd old_clamav_directory
2) make uninstall
3) cd new_clamav_directory
4) ./configure;make;make install

If you don't have the old directory, the new one should work, too.
 

Valetia

Well-Known Member
Jun 20, 2002
216
10
168
cPanel Access Level
Root Administrator
Originally posted by casey
Exact steps:

1) cd old_clamav_directory
2) make uninstall
3) cd new_clamav_directory
4) ./configure;make;make install

If you don't have the old directory, the new one should work, too.
I'm confused. Where do you find old_clamav_directory and new_clamav_directory? :confused:
 

guaru

Member
Feb 2, 2004
5
0
151
Brasil
Hi

after a lot of work i instaled MAIL::Clamav

but how can it be working with mailscanner?
i´ve changed the line in MailScanner.conf
but it´s not working

what should I put in the virus.scanners.conf because this line is

clamavmodule /bin/false /tmp

what more I need to change?

Thanks

Fabio
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
3 things:

1. You should change the line in MailScanner.conf if you haven't already:

Virus Scanners = clamavmodule

2. You must install at least v0.70 of ClamAV

3. You must stop and restart MailScanner
 

Valetia

Well-Known Member
Jun 20, 2002
216
10
168
cPanel Access Level
Root Administrator
I have ClamAV 0.70 installed and upgraded MailScanner successfully to the latest version.

However when I try to install the clamav Perl module, this error shows up:

PHP:
Checking if your kit is complete...
Looks good
Writing Makefile for Mail::ClamAV
cp ClamAV.pm blib/lib/Mail/ClamAV.pm
/usr/bin/perl -Mblib -MInline=NOISY,_INSTALL_ -MMail::ClamAV -e1 0.08 blib/arch
Starting Build Prepocess Stage
Finished Build Prepocess Stage

Starting Build Parse Stage
Finished Build Parse Stage

Starting Build Glue 1 Stage
Finished Build Glue 1 Stage

Starting Build Glue 2 Stage
Finished Build Glue 2 Stage

Starting Build Glue 3 Stage
Finished Build Glue 3 Stage

Starting Build Compile Stage
  Starting "perl Makefile.PL" Stage
Writing Makefile for Mail::ClamAV
  Finished "perl Makefile.PL" Stage

  Starting "make" Stage
make[1]: Entering directory `/home/.cpan/build/Mail-ClamAV-0.08/_Inline/build/Mail/ClamAV'
/usr/bin/perl /usr/lib/perl5/5.8.1/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.8.1/ExtUtils/typemap   ClamAV.xs > ClamAV.xsc && mv ClamAV.xsc ClamAV.c
cc -c  -I/home/.cpan/build/Mail-ClamAV-0.08 -I/usr/include -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O3   -DVERSION=\"0.08\" -DXS_VERSION=\"0.08\" -fpic "-I/usr/lib/perl5/5.8.1/i686-linux/CORE"   ClamAV.c
Running Mkbootstrap for Mail::ClamAV ()
chmod 644 ClamAV.bs
rm -f blib/arch/auto/Mail/ClamAV/ClamAV.so
LD_RUN_PATH="/usr/lib:/lib:/usr/local/lib" cc  -shared -L/usr/local/lib ClamAV.o  -o blib/arch/auto/Mail/ClamAV/ClamAV.so   -lz -lbz2 -lgmp -lpthread -lclamav   
/usr/bin/ld: cannot find -lbz2
collect2: ld returned 1 exit status
make[1]: *** [blib/arch/auto/Mail/ClamAV/ClamAV.so] Error 1
make[1]: Leaving directory `/home/.cpan/build/Mail-ClamAV-0.08/_Inline/build/Mail/ClamAV'

A problem was encountered while attempting to compile and install your Inline
C code. The command that failed was:
  make

The build directory was:
/home/.cpan/build/Mail-ClamAV-0.08/_Inline/build/Mail/ClamAV

To debug the problem, cd to the build directory, and inspect the output files.

 at /home/.cpan/build/Mail-ClamAV-0.08/blib/lib/Mail/ClamAV.pm line 150
BEGIN failed--compilation aborted at /home/.cpan/build/Mail-ClamAV-0.08/blib/lib/Mail/ClamAV.pm line 429.
Compilation failed in require.
BEGIN failed--compilation aborted.
make: *** [ClamAV.inl] Error 2
  /usr/bin/make  -- NOT OK
Running make install
  make had returned bad status, install seems impossible
perlmod--Install done
On RH9 with gdbm and gdbm_devel already installed correctly. Help!
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
The problem is in the error message ;)

/usr/bin/ld: cannot find -lbz2

try:

up2date -i bzip2-devel

Then try the compiling the perl module again.
 

Valetia

Well-Known Member
Jun 20, 2002
216
10
168
cPanel Access Level
Root Administrator
Originally posted by chirpy
The problem is in the error message ;)

/usr/bin/ld: cannot find -lbz2

try:

up2date -i bzip2-devel

Then try the compiling the perl module again.
OK that eliminated the error but another one is coming up:

/usr/bin/ld: cannot find -lgmp

What up2date statement should I use now?

Related question, how did you know lbz2 means bzip2-devel? Is there a place that lists all these abbreviations.
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
I checked on a working server, like this:

locate libgmp.so

this gives you the file location. Then to establish which rpm it belongs to:

rpm -qf /usr/lib/libgmp.so

which gives you gmp-devel, so:

up2date -i gmp gmp-devel

:cool:
 

Valetia

Well-Known Member
Jun 20, 2002
216
10
168
cPanel Access Level
Root Administrator
Originally posted by chirpy
I checked on a working server, like this:

locate libgmp.so

this gives you the file location. Then to establish which rpm it belongs to:

rpm -qf /usr/lib/libgmp.so

which gives you gmp-devel, so:

up2date -i gmp gmp-devel

:cool:
Thanks! Works now.

Silly question but how did you know that lgmp means libgmp.so? Do you just treat all initial l's as libs and then add a .so at the end? :D

Also - how did you come up with this:

up2date -i gmp gmp-devel

while the one for bzip2 was:

up2date -i bzip2-devel

rather than the following:

up2date -i bzip2 bzip2-devel

Or would the latter work too?
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
Yes, -l is compiling with a link to a library. So -lgmp is linking with libgmp.so. Located the file and checked which rpm it belonged to.

You were highli likely to have had bzip2 already installed, so I only mentioned bzip2.devel, I was just more thorough with gmp ;) If you'd already had one of those installed up2date would have told you.

Glad you got it working :)
 

guaru

Member
Feb 2, 2004
5
0
151
Brasil
Originally posted by chirpy
3 things:

1. You should change the line in MailScanner.conf if you haven't already:

Virus Scanners = clamavmodule

2. You must install at least v0.70 of ClamAV

3. You must stop and restart MailScanner
Ok, i did that, upgraded all the mailscanner and clamav, instaled the clamavmodule changed the line in MailScanner.conf

But the line in virus.scanners.conf is not showing the path to clamavmodule

I need this file

Thanks
 

Rubas

Well-Known Member
Sep 15, 2003
125
0
166
Do not forget this steps!

Originally posted by casey
I also had to install the following perl modules:
Net::CIDR
Inline

Then I had to change the following line in MailScanner.conf:
Monitors for ClamAV Updates = /usr/local/share/clamav/*.cvd
to:
Monitors for ClamAV Updates = /usr/share/clamav/*.cvd
 

guaru

Member
Feb 2, 2004
5
0
151
Brasil
Thanks

now it´s working, it was missing the /usr/share

do I need to do something more to keep it updated or only the

grep freshclam

I´ve done that
cat /scripts/upcp | grep freshclam
to keep it auto updated
 

goodmove

Well-Known Member
May 12, 2003
643
4
168
Originally posted by chirpy
MailScanner updates ClamAV for you - it checks on the hour for new virus definitions.
The auto-update wasn't somehow working. So I've added this to /etc/crontab:

47 * * * * root freshclam --quiet -l /var/log/clam-update.log > /dev/null 2>&1
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
For some reason the layer1 install doesn't copy in the cron job. What you've done does the job nicely :)

You could also use the one included with MailScanner:
Code:
cd /etc/cron.hourly
ln -s /usr/mailscanner/bin/update_virus_scanners