Page 2 of 2

Re: Clamd Anacron job 'cron.daily'

Posted: Wed Nov 19, 2014 5:47 am
by shua
ls -l /etc/clamd.conf
-rw-r--r-- 1 root root 14960 Nov 18 2012 /etc/clamd.conf

Re: Clamd Anacron job 'cron.daily'

Posted: Wed Nov 19, 2014 5:57 am
by joem
Try changing the user from clamav to clam for both freshclam.log clamd.log files.

Re: Clamd Anacron job 'cron.daily'

Posted: Wed Nov 19, 2014 2:16 pm
by Shua613
changed chown and chgrp didn't help
I tried sudo service clamd start (adding sudo and that gave me)
Starting Clam AntiVirus Daemon: LibClamAV Warning: **************************************************
LibClamAV Warning: *** The virus database is older than 7 days! ***
LibClamAV Warning: *** Please update it as soon as possible. ***
LibClamAV Warning: **************************************************
ERROR: LOCAL: Socket file /var/run/clamav/clamd.sock could not be bound: Permission denied
ERROR: Can't unlink the socket file /var/run/clamav/clamd.sock
[FAILED]

Re: Clamd Anacron job 'cron.daily'

Posted: Wed Nov 19, 2014 11:09 pm
by joem
Shua613 wrote:changed chown and chgrp didn't help
I tried sudo service clamd start (adding sudo and that gave me)
Starting Clam AntiVirus Daemon: LibClamAV Warning: **************************************************
LibClamAV Warning: *** The virus database is older than 7 days! ***
LibClamAV Warning: *** Please update it as soon as possible. ***
LibClamAV Warning: **************************************************
ERROR: LOCAL: Socket file /var/run/clamav/clamd.sock could not be bound: Permission denied
ERROR: Can't unlink the socket file /var/run/clamav/clamd.sock
[FAILED]

Did you reset the user back to clamav or leave them to clam before you ran the command service clamd start?

Re: Clamd Anacron job 'cron.daily'

Posted: Thu Nov 20, 2014 1:51 am
by Shua613
see http://zend.to/clamavpermissions.php#permissions
I found the following it worked for me except I needed to change one thing right below here
-rw-r--r-- 1 clamav clamav 1396 Jul 27 07:13 freshclam.log
to
-rw-r--r-- 1 clam clam 1396 Jul 27 07:13 freshclam.log

The following is all based on the line

User clam
appearing in the file /etc/clamd.conf.
/var/log/clamav

To check this, run the command "freshclam" as root. If it produces an error about the log file, make sure the ownership of the directory and the files in it are set as follows:

drwxr-xr-x 2 clamav clamav 4096 Jul 25 11:04 .
drwxr-xr-x 7 root root 4096 Jun 16 04:02 ..
-rw-r--r-- 1 clam clam 11208 Jul 27 14:09 clamd.log
-rw-r--r-- 1 clamav clamav 1396 Jul 27 07:13 freshclam.log
/var/run/clamav

To check this, run the command "service clamd restart" as root. Check that the last entry in the file /var/log/clamav/clamd.log has just been written (they are all timestamped) and see if it produces any errors about the socket file. If it does, then make sure the ownership of the directory and the files in /var/run/clamav are set as follows:

drwxr-xr-x 2 clam clam 4096 Jul 27 13:59 .
drwxr-xr-x 12 root root 4096 Jul 27 13:59 ..
-rw-rw-r-- 1 clam clam 4 Jul 27 13:59 clamd.pid
srw-rw-rw- 1 clam clam 0 Jul 27 13:59 clamd.sockns