Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: Scummy on January 29, 2007, 01:28:53 AM

Title: Cannot connect to /var/lib/clamav/clamd.sock.
Post by: Scummy on January 29, 2007, 01:28:53 AM
im looking in the sme webpage at Antivirus and all problem e-mails appear to have this error under them

Cannot connect to /var/lib/clamav/clamd.sock.

what does this mean and how do i fix it? My Master IT person is away for a period of time and my office needs this fixed

cheers
Title: Re: Cannot connect to /var/lib/clamav/clamd.sock.
Post by: psoren on January 29, 2007, 07:47:56 AM
Quote from: "Scummy"
im looking in the sme webpage at Antivirus and all problem e-mails appear to have this error under them

Cannot connect to /var/lib/clamav/clamd.sock.

what does this mean and how do i fix it? My Master IT person is away for a period of time and my office needs this fixed

cheers


It means it can not scan the mail for virus because something is crashing clam antivirus. The quick easy fix is probably a reboot, but something must have killed it.

Per
Title: Cannot connect to /var/lib/clamav/clamd.sock.
Post by: Gert on January 31, 2007, 11:04:11 PM
I have had the same problem, it was due to some memory allocation error. It made mysqld die and then clamd.

to get it working again try:

service mysqld start
service clamd start

it might work for a while and then die again like in my case.  I used a cron entry to start these services every 10 minutes for safety till i had time to reload the server. mine used to die about once a day.
Title: Cannot connect to /var/lib/clamav/clamd.sock.
Post by: Scummy on February 01, 2007, 07:28:11 AM
How do i go about writing the cron entry to make it keep starting mysqld and clamd till i can reload?
Title: Cannot connect to /var/lib/clamav/clamd.sock.
Post by: Gert on February 01, 2007, 07:58:08 AM
1. First we create a custom template folder:

mkdir -p /etc/e-smith/templates-custom/etc/crontab

2. Then create a new template file with pico or vi:

vi /etc/e-smith/templates-custom/etc/crontab/78fixclam

3. In the file put the following:

*/10 * * * * root service mysqld start 2>&1
*/10 * * * * root service clamd start 2>&1

4. Then save the file and expand the template:

expand-template /etc/crontab

5. And finally restart cron:

service crond restart

You can view /var/log/cron to see if it works. To undo your changes simly delete the file 78fixclam and repeat steps 4 and 5.

Hope it helps
Title: Cannot connect to /var/lib/clamav/clamd.sock.
Post by: CharlieBrady on February 02, 2007, 06:01:31 AM
Quote from: "Gert"

3. In the file put the following:

*/10 * * * * root service mysqld start 2>&1
*/10 * * * * root service clamd start 2>&1


No, don't do that. In SME7, both mysql and clamd are supervised (by runsv). If they ever die, they will be restarted within 5 seconds.
Title: Cannot connect to /var/lib/clamav/clamd.sock.
Post by: Gert on February 02, 2007, 06:51:13 AM
Thats good to know, my problem was in sme6 so my temporarely fix saved me a lot of time. So if in sme7 runsv restarts mysqld and clamd automatically, why would Scummy then get "Cannot connect to /var/lib/clamav/clamd.sock"?
Title: Cannot connect to /var/lib/clamav/clamd.sock.
Post by: william_syd on February 02, 2007, 09:33:34 AM
Maybe his IT person played with it.

Try the following command..
Code: [Select]
[root@tiger ~]# config show clamd
clamd=service
    MemLimit=80000000
    status=enabled
[root@tiger ~]#

and
Code: [Select]
/etc/rc7.d//S80clamd status