Koozali.org: home of the SME Server

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

Scummy

Cannot connect to /var/lib/clamav/clamd.sock.
« 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

Offline psoren

  • *
  • 371
  • +0/-0
Re: Cannot connect to /var/lib/clamav/clamd.sock.
« Reply #1 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

Offline Gert

  • *****
  • 208
  • +0/-0
    • http://www.huge.co.za
Cannot connect to /var/lib/clamav/clamd.sock.
« Reply #2 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.

Scummy

Cannot connect to /var/lib/clamav/clamd.sock.
« Reply #3 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?

Offline Gert

  • *****
  • 208
  • +0/-0
    • http://www.huge.co.za
Cannot connect to /var/lib/clamav/clamd.sock.
« Reply #4 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

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Cannot connect to /var/lib/clamav/clamd.sock.
« Reply #5 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.

Offline Gert

  • *****
  • 208
  • +0/-0
    • http://www.huge.co.za
Cannot connect to /var/lib/clamav/clamd.sock.
« Reply #6 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"?

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Cannot connect to /var/lib/clamav/clamd.sock.
« Reply #7 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
Regards,
William

IF I give advise.. It's only if it was me....