LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-04-2008, 04:01 AM   #1
gnurza
LQ Newbie
 
Registered: Sep 2007
Posts: 13

Rep: Reputation: 0
Clamav: Error on scan


I've installed clamav v0.90.1 on a laptop running Debian Etch. On executing the clamscan command I'm getting the following:

LibClamAV Error: cl_load(): Unable to lock database directory: /var/lib/clamav/
ERROR: Unable to lock database directory


How do I get clamscan to complete scanning without any errors?

Thanks.
 
Old 03-04-2008, 04:22 AM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Are you running clamscan as an unprivileged user? The directory /var/lib/clamav is probably owned by the clamav user and the clamav group.

On my system (Slackware), the equivalent directory (/usr/share/clamav as it happens) has rwxrwx--- permissions, so only members of the clamav group, the clamav user and root have permissions to read/write there.

As a solution, you can either run clamscan as root or add yourself to the clamav group. There may also be more or less secure ways of gaining access to that directory (chmod...).

Your choice
 
Old 03-04-2008, 05:23 AM   #3
gnurza
LQ Newbie
 
Registered: Sep 2007
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks pwc101 for your response.

I have tried running clamscan as root but to no avail; the same error still occurs
 
Old 03-04-2008, 06:00 AM   #4
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Does /var/lib/clamav exist? If not, might be worth creating it as root, and then trying again. If it does exist, what is the output of
Code:
ls -l /var/lib/clamav
?
 
Old 03-04-2008, 06:44 AM   #5
gnurza
LQ Newbie
 
Registered: Sep 2007
Posts: 13

Original Poster
Rep: Reputation: 0
Code:
...# ls -l /var/lib/clamav/
-rw-r--r-- 1 root   root    911975 2008-03-04 10:54 daily.cvd
-rw-r--r-- 1 root   root   8189490 2008-03-04 10:54 main.cvd
drwxr-xr-x 2 clamav clamav    4096 2008-03-04 13:50 main.inc
 
Old 03-04-2008, 07:27 AM   #6
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Whoops, my mistake. Can you post the output of
Code:
ls -ld /var/lib/clamav
Thanks.
 
Old 03-04-2008, 07:39 AM   #7
gnurza
LQ Newbie
 
Registered: Sep 2007
Posts: 13

Original Poster
Rep: Reputation: 0
here we go...

Code:
 ls -ld /var/lib/clamav/
drwxr-xr-x 4 clamav clamav 4.0K 2008-03-04 15:39 /var/lib/clamav//
 
Old 03-04-2008, 08:19 AM   #8
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Hmmm. Odd. It has more open permissions than mine, and yet you get a permissions error.

The only thing I've seen about this (I did a quick google of the error message) is that it's a problem with 0.90.x installations, and upgrading to a more recent version (currently at 0.92.1) might fix it.

Or, http://permalink.gmane.org/gmane.lin...general/380220 seems to suggest that if you chown all files in /var/lib/clamav to clamav:clamav, then that might also fix it.
 
Old 03-04-2008, 08:29 AM   #9
gnurza
LQ Newbie
 
Registered: Sep 2007
Posts: 13

Original Poster
Rep: Reputation: 0
Thumbs up

Thanks for your help. Changing ownership to clamav solved the problem! Yay!
 
Old 03-04-2008, 08:34 AM   #10
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Cool, glad it's fixed.
 
  


Reply

Tags
clamav


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ClamAV scan with a LiveCD AvatarofVirgo Linux - Security 4 10-12-2007 05:08 PM
How do I send daily clamav scan logs to my work e-mail account rwtreke Suse/Novell 3 05-20-2005 12:05 PM
What is the best way to get clamav to scan emails? luca2005 Linux - Software 0 12-12-2004 04:52 AM
Clamav scan on demmand rooch84 Linux - Security 9 08-16-2004 09:38 AM
1st ClamAV scan.. 48 files infected... What??!! sh1ft Linux - Security 2 06-29-2004 10:06 PM


All times are GMT -5. The time now is 01:35 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration