ClamAV permission problem

Hey guys whats up!
So I decided the upgrade from 6.1 to 7.2 was giving me too much of a hard time so I decided to start everything from scratch.
So far I have not had any problems with the installation
I did however do something that I know I should not have done.
I issued this command

Code:
#chown –R vscan:vscan /var/db/clamav
#chown –R vscan:vscan /var/log/clamav
#chown –R vscan:vscan /var/run/clamav

and now I get an error saying
Code:
Starting clamav_clamd
ERROR: Can't open /var/log/clamav/clamd.log in append mode (check permissions!).
ERROR: Cant initialize internal logger
Starting clamav_freshclam
ERROR: Can't open /var/log/clamav/freshclam.log in append mode (check permissions!).
ERROR: Probem with Internal logger (UpdateLogFile = /var/log/clamav/freshclam.log)
Waiting for clamd socket....60...50...40...30...20...10...
and then it fails


I think I changed some kind of permission but I don't know how to put it back to normal.

I issued these commands from this url
Code:
http://forums.freebsd.org/showthread.php?t=5919

Code:
touch /var/log/clamd.log
chown vscan:vscan /var/log/clamd.log

Code:
mkdir /var/log/clamav
touch /var/log/clamav/clamd.log
chown -R vscan:vscan /var/log/clamav

but I still get the error
how do I put it back to normal?
 
It's fairly hard to guess what the problem is with the information presented not giving the whole picture. However, I would suggest that vscan may not be what clamav is running as.

A lot of setups use different permissions:
Code:
-rw-r-----  1 clamav  clamav   630K Aug 10 14:32 clamd.log
-rw-r-----  1 clamav  clamav   868K Aug 10 14:22 freshclam.log
That is my /var/log/clamav directory. You need to verify the user/group you are running as.

Also you may need to look in your /usr/local/etc/clamd.conf file for:
Code:
# Run as another user (clamd must be started by root for this option to work)
# Default: don't drop privileges
User clamav
 
Then repeat those commands with clamav:clamav instead of vscan:vscan ..
 
Did you also touch and chown /var/log/clamav/freshclam.log?

What output do you get after that?
 
I did
Code:
chown -R clamav:clamav /var/log/clamav/clamd.log
touch clamav:clamav /var/log/clamav/clamd.log
chown -R clamav:clamav /var/log/clamav/freshclam.log
touch clamav:clamav /var/log/clamav/freshclam.log

and

Code:
touch clamav:clamav /var/log/clamav/clamd.log
chown -R clamav:clamav /var/log/clamav/clamd.log
touch clamav:clamav /var/log/clamav/freshclam.log
chown -R clamav:clamav /var/log/clamav/freshclam.log

all 3 were done on seperate reboot occasions
i also did
Code:
#chown –R vscan:vscan /var/db/clamav
#chown –R vscan:vscan /var/log/clamav
#chown –R vscan:vscan /var/run/clamav

nothing worked.
 
The 'chown -R' command is supposed to be applied to directories (recursive chown), not files. If the directory is not owned by clamav, it cannot create files in it.

Try [cmd=]chown -R clamav:clamav /var/log/clamav /var/db/clamav /var/run/clamav[/cmd]

Forget about the vscan user/group, unless you have it configured somewhere in clamav config files.
 
I tried that command it does nothing I still get the same error :(
the attachment is exactly my error
 

Attachments

  • clam av.JPG
    clam av.JPG
    65.6 KB · Views: 2,274
What is the output of:

[cmd=]ls -ld /var/log/clamav
ls -al /var/log/clamav[/cmd] ?
 
Back
Top