If you are running clamav daemon on debian etch, and your clamav daemon takes up to 3-4 minutes to create the unix socket and the pid file, don't despair it's an clamav bug.
While you are running clamav with amavis this bug can be very annoying:
amavis[22480]: (21470-02) (!!) ClamAV-clamd av-scanner FAILED: Too many retries to talk to /var/run/clamav/clamd.ctl (Can't connect to UNIX socket
If you strace your clamv on the startup time you get many of these messages:
read(10, "n.Downloader-14249\n29184:5d2a569"..., 4096) = 4096
read(10, "15872:15a82a8cbbb437f9249c944391"..., 4096) = 4096
read(10, "a6288c61679d87f00:Trojan.Bancos-"..., 4096) = 4096
read(10, "db2a:Trojan.IRCBot-1189\n24576:5e"..., 4096) = 4096
The clamav version is debian etch is 0.90.1.
The bug is fixed in version 0.91rc2. So you could use the
backports.org packages (0.91.2).