Hi there,

On Sun, 27 Sep 2009 Agostinho Carvalho wrote:

> New Clam user here, so please be gentile  :-)

Er, gentle.  I'll try. :)

> WARNING: Clamd was NOT notified: Can't connect to clamd through 
> /var/lib/clamav/clamd-socket
> connect(): No such file or directory

The 'clamd' daemon can listen (and talk) to other processes using a
'socket'.  The socket is created by clamd when it starts and should be
destroyed by clamd when it stops gracefully, although a process which
is killed, or dies unexpectedly, might leave an unused 'stale' socket
lying around.  Sometimes that can cause a problem.  A socket is either
a special file in the filesystem, or a network construct.  Both are
supported by freshclam and clamd.  You can use tools like 'ls' to see
a filesystem socket in a directory listing.  You can use network tools
like 'socat' to do things with network sockets.  If you're feeling
brave, you can send and receive messages through the socket, by hand,
using the console, e.g. with 'telnet'.  It's in the documentation.
Try for example:

man clamd

and

man freshclam

Note that you need to decide which kind of socket your clamd will be
using: TCP (network style) sockets or filesystem sockets; and the
processes have to agree on the details.  It looks like your freshclam
thinks it's a filesystem socket, but freshclam is telling you that
/var/lib/clamav/clamd-socket doesn't exist.  That probably means it
isn't there.

Different Linux distributions often supply software packages like
ClamAV changed from the versions distributed by the authors in subtle
(and sometimes not so subtle:) ways.  Unfortunately different Linux
distributions have different ideas about where things should be in the
filesystem, and sometimes these ideas change from one version (of the
distribution, or of any given software package in said distribution)
to the next.  Have you updated some software, or have you put the
socket somewhere else?  This has often led people up the garden path.
Or has it just disappeared?  Sometimes it happens.  Can you prove it?

A process which needs to talk to clamd needs to know where the socket
is, and the location is in the configuration file for clamd.  If the
socket isn't at the expected place it might mean one of several things:

1. The clamd process isn't running, so it didn't create the socket yet.
2. Your expectation is wrong (possible).
3. Clamd isn't creating a socket at all when it runs (unlikely).
4. Clamd creates the socket at some other place (likely).
5. Clamd isn't creating a socket and then it's disappearing (unlikely).
6. Something else I haven't thought of (very possible).

I use the terms 'where' and 'place' even though a network socket
doesn't exactly have a whereabouts like a filesystem socket.

According to the documentation, freshclam reads the configuration file
that clamd is using.  Make sure that it does.  Make sure that it's the
same configuration file that clamd is reading when it starts, that's
another thing that often leads people a merry dance.  Look in clamd's
configuration file to find out where things should be.  Then stop and
start the daemon to make sure that the socket is created in the right
place.  Then make sure that freshclam has the same notion of where the
socket should be that clamd has.  Make sure you can communicate with
the daemon as it says in the man pages.

You might also try Googling for "freshclam socket" or something similar.

If all else fails, get back to us with a _detailed_ description of the
things that you've tried.

--

73,
Ged.
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to