1

Topic: connect to /var/run/clamd.amavisd/clamd.socket failed, attempt #1:

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):  0.9.6 OPENLDAP edition.
- Deployed with iRedMail Easy or the downloadable installer? yes
- Linux/BSD distribution name and version: ceontos 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):apache
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Today I had mails in queue and problem:
amavis[13830]: (13830-01) (!)connect to /var/run/clamd.amavisd/clamd.socket failed, attempt #1: Can't connect to a UNIX socket /var/run/clamd.amavisd/clamd.socket: No such file or directory

I had to fallow this article https://docs.iredmail.org/completely.di … assin.html
uncommect this line: @bypass_virus_checks_maps = (1);  # controls running of anti-virus code
and restart services. Mail went to boxes (postfix flush).
But I have still this roblem when enabling this opition in /etc/amavisd/amavisd.conf
I need to scan mails, why cant start the service?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: connect to /var/run/clamd.amavisd/clamd.socket failed, attempt #1:

hi, I look in /var/log/maillog and see
Jan  7 12:34:01 mail amavis[9387]: (09387-09) (!)run_av (ClamAV-clamscan): collect_results - reading aborted: timed out at /usr/sbin/amavisd line 4972.
Jan  7 12:34:01 mail amavis[9387]: (09387-09) (!)ClamAV-clamscan av-scanner FAILED: run_av error: Exceeded allowed time\n
Jan  7 12:34:02 mail amavis[9387]: (09387-09) (!!)AV: ALL VIRUS SCANNERS FAILED

Jan  7 12:34:41 mail amavis[10621]: (10621-06) (!)terminating process [12244] running ClamAV-clamscan (reason: on reading: timed out)
Jan  7 12:34:43 mail amavis[10621]: (10621-06) (!)process [12244] running ClamAV-clamscan is still alive, using a bigger hammer (SIGKILL)
Jan  7 12:34:43 mail amavis[10621]: (10621-06) (!)run_av (ClamAV-clamscan): collect_results - reading aborted: timed out at /usr/sbin/amavisd line 4972.
Jan  7 12:34:43 mail amavis[10621]: (10621-06) (!)ClamAV-clamscan av-scanner FAILED: run_av error: Exceeded allowed time\n
Jan  7 12:34:43 mail amavis[10621]: (10621-06) (!!)AV: ALL VIRUS SCANNERS FAILED


Please any idea? I seams like same a lock file or .pid exists.
I had to disable virus scanning to start clamav service.

because of in mail queue was big amount of mails.

3

Re: connect to /var/run/clamd.amavisd/clamd.socket failed, attempt #1:

ClamAV service is not running. Please try to restart it.
How much memory does this server have? Better have at least 4GB.

4 (edited by m.krzaczek 2020-01-09 16:29:39)

Re: connect to /var/run/clamd.amavisd/clamd.socket failed, attempt #1:

Hi all, thanks for reply
It seams, (after server restart) all is ok. It looks like amavis service try to contact with clamd but it not fully started, therefore this message about "Can't connect to a UNIX socket /var/run/clamd.amavisd/clamd.socket:". But, regardless, postfix runs, mails not stuck in queue, viruses are scanned (yes, I recieved email that clam found suspiciuos one).

Logs after full reboot:

Jan  8 16:03:09 mail clamd[1002]: Loaded 6659512 signatures.

then starts amavis, clamd still not fully started, becouse:

Jan  8 16:03:11 mail amavis[2743]: (02743-01) (!)connect to /var/run/clamd.amavisd/clamd.socket failed, attempt #1: Can't connect to a UNIX socket /var/run/clamd.amavisd/clamd.socket:  No such file or directory

then in log, clamd keep starting:

Jan  8 16:03:12 mail clamd[1002]: LOCAL: Unix socket file /var/run/clamd.amavisd/clamd.socket
Jan  8 16:03:12 mail clamd[1002]: LOCAL: Setting connection queue length to 200
Jan  8 16:03:12 mail clamd[1002]: Limits: Global size limit set to 104857600 bytes.
Jan  8 16:03:12 mail clamd[1002]: Limits: File size limit set to 26214400 bytes.
Jan  8 16:03:12 mail clamd[1002]: Limits: Recursion level limit set to 16.
Jan  8 16:03:12 mail clamd[1002]: Limits: Files limit set to 10000.
Jan  8 16:03:12 mail clamd[1002]: Limits: MaxEmbeddedPE limit set to 10485760 bytes.
Jan  8 16:03:12 mail clamd[1002]: Limits: MaxHTMLNormalize limit set to 10485760 bytes.
Jan  8 16:03:12 mail clamd[1002]: Limits: MaxHTMLNoTags limit set to 2097152 bytes.
Jan  8 16:03:12 mail clamd[1002]: Limits: MaxScriptNormalize limit set to 5242880 bytes.
Jan  8 16:03:12 mail clamd[1002]: Limits: MaxZipTypeRcg limit set to 1048576 bytes.
Jan  8 16:03:12 mail clamd[1002]: Limits: MaxPartitions limit set to 50.
Jan  8 16:03:12 mail clamd[1002]: Limits: MaxIconsPE limit set to 100.
Jan  8 16:03:12 mail clamd[1002]: Limits: MaxRecHWP3 limit set to 16.
Jan  8 16:03:12 mail clamd[1002]: Limits: PCREMatchLimit limit set to 10000.
Jan  8 16:03:12 mail clamd[1002]: Limits: PCRERecMatchLimit limit set to 5000.
Jan  8 16:03:12 mail clamd[1002]: Limits: PCREMaxFileSize limit set to 26214400.
Jan  8 16:03:12 mail clamd[1002]: Archive support enabled.
Jan  8 16:03:12 mail clamd[1002]: Algorithmic detection enabled.
Jan  8 16:03:12 mail clamd[1002]: Portable Executable support enabled.
Jan  8 16:03:12 mail clamd[1002]: ELF support enabled.
Jan  8 16:03:12 mail clamd[1002]: Mail files support enabled.
Jan  8 16:03:12 mail clamd[1002]: OLE2 support enabled.
Jan  8 16:03:12 mail clamd[1002]: PDF support enabled.
Jan  8 16:03:12 mail clamd[1002]: SWF support enabled.
Jan  8 16:03:12 mail clamd[1002]: HTML support enabled.
Jan  8 16:03:12 mail clamd[1002]: XMLDOCS support enabled.
Jan  8 16:03:12 mail clamd[1002]: HWP3 support enabled.
Jan  8 16:03:12 mail clamd[1002]: Self checking every 600 seconds.


Before full reboot I was trying this prodecure:

systemctl stop  amavisd.service
systemctl stop  clamd@amavisd.service

systemctl start  amavisd.service
systemctl start  clamd@amavisd.service
systemctl restart postfix

but all new mails stucked in queue.
the Only help was to disable scannig in /etc/amavisd/amavisd.conf :

@bypass_virus_checks_maps = (1);  # controls running of anti-virus code
# @bypass_spam_checks_maps  = (1);  # controls running of anti-spam code

(hush removing)
and restart services again.

I have 4GB ram.

I found the article that we can increase time out when amavis starts in file:
/usr/lib/systemd/system/clamd@.service
add enrty:
timeout 180
(180 sek), but it was not helpul (when I was restaritng services).

Now it seams, that amavis first can't connect to clamav, but eventually it can connect. All is as before.

5

Re: connect to /var/run/clamd.amavisd/clamd.socket failed, attempt #1:

- Try to increase the "timeout" value in systemd file to, e.g. 600 seconds.
- Make sure you're running the latest clamav packages with "yum update" command.