1 (edited by LainX84 2020-09-04 04:01:09)

Topic: Amavisd dead itself

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer? No
- Linux/BSD distribution name and version: CentOS Linux release 7.8.2003 (Core)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi all,

over my friend server where i've install 1 year ago iRedMail, we are facing an issue with amavisd.service
Randomly that service died itself and every mail will put in queue (deffered).
The only way to make it run again is restart amavisd.service and perform 'postfix flush -vvvvv' command.

Here what i found over logs / journalctl :

[root@srv-main ~]# systemctl status amavisd.service
● amavisd.service - Amavis mail content checker
   Loaded: loaded (/usr/lib/systemd/system/amavisd.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: http://www.ijs.si/software/amavisd/#doc

[root@srv-main ~]# journalctl -xe | grep -i 'amavisd'
Sep 03 14:35:08 srv-main.nuovalineamelzo.it systemd[1]: Starting clamd scanner (amavisd) daemon...
-- Subject: Unit clamd@amavisd.service has begun start-up
-- Unit clamd@amavisd.service has begun starting up.
Sep 03 14:35:08 srv-main.nuovalineamelzo.it clamd[827]: WARNING: Ignoring deprecated option AllowSupplementaryGroups at /etc/clamd.d/amavisd.conf:21
Sep 03 14:35:45 srv-main.nuovalineamelzo.it clamd[827]: LOCAL: Unix socket file /var/run/clamd.amavisd/clamd.socket
Sep 03 14:36:46 srv-main.nuovalineamelzo.it systemd[1]: Started clamd scanner (amavisd) daemon.
-- Subject: Unit clamd@amavisd.service has finished start-up
-- Unit clamd@amavisd.service has finished starting up.

[root@srv-main log]# cat messages | grep -i 'amavisd'
Aug 30 20:05:35 srv-main mariadbd: 2020-08-30 20:05:35 659 [Warning] Aborted connection 659 to db: 'amavisd' user: 'amavisd' host: 'localhost' (Got timeout reading communication packets)
Aug 31 14:20:50 srv-main systemd: Stopping clamd scanner (amavisd) daemon...
Aug 31 14:22:27 srv-main systemd: Starting clamd scanner (amavisd) daemon...
Aug 31 14:22:27 srv-main clamd: WARNING: Ignoring deprecated option AllowSupplementaryGroups at /etc/clamd.d/amavisd.conf:21
Aug 31 14:24:06 srv-main systemd: Started clamd scanner (amavisd) daemon.
Sep  1 06:35:21 srv-main mariadbd: 2020-09-01  6:35:21 545 [Warning] Aborted connection 545 to db: 'amavisd' user: 'amavisd' host: 'localhost' (Got timeout reading communication packets)
Sep  2 06:58:59 srv-main mariadbd: 2020-09-02  6:58:59 2960 [Warning] Aborted connection 2960 to db: 'amavisd' user: 'amavisd' host: 'localhost' (Got timeout reading communication packets)
Sep  3 06:51:29 srv-main mariadbd: 2020-09-03  6:51:29 5325 [Warning] Aborted connection 5325 to db: 'amavisd' user: 'amavisd' host: 'localhost' (Got timeout reading communication packets)
Sep  3 14:22:02 srv-main systemd: Starting clamd scanner (amavisd) daemon...
Sep  3 14:22:02 srv-main clamd: WARNING: Ignoring deprecated option AllowSupplementaryGroups at /etc/clamd.d/amavisd.conf:21
Sep  3 14:24:02 srv-main systemd: Started clamd scanner (amavisd) daemon.

[root@srv-main log]# cat maillog | grep -i 'amavisd'
Aug 31 12:03:52 srv-main amavis[3836]: starting. /usr/sbin/amavisd at srv-main.nuovalineamelzo.it amavisd-new-2.12.0 (20190725), Unicode aware, LANG="en_US.UTF-8"
Aug 31 14:23:06 srv-main clamd[838]: LOCAL: Unix socket file /var/run/clamd.amavisd/clamd.socket
Sep  1 09:02:21 srv-main amavis[20684]: starting. /usr/sbin/amavisd at srv-main.nuovalineamelzo.it amavisd-new-2.12.0 (20190725), Unicode aware, LANG="en_US.UTF-8"
Sep  3 06:04:17 srv-main amavis[3611]: starting. /usr/sbin/amavisd at srv-main.nuovalineamelzo.it amavisd-new-2.12.0 (20190725), Unicode aware, LANG="en_US.UTF-8"
Sep  3 14:22:46 srv-main clamd[838]: LOCAL: Unix socket file /var/run/clamd.amavisd/clamd.socket

How can I prevent and fix the problem as I cannot connect to the server daily to check and fix it.
If not, I assume I will have to perform him a 'backup' and 'restore' of the VPS starting from the email boxes and the Wordpress site.

----

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

2

Re: Amavisd dead itself

I suspect we had the same issue, OP. I noticed all of my mails had stopped flowing. Upon further investigation, I found amavisd was stopped. I started it and restarted postfix and the mailq started to slowly empty. So why was amavisd dead? I started investigating. I found this:

root@mail:/var/log
$ cat messages | grep -i 'amavisd'
Sep  2 12:57:46 mail systemd: Starting Clean amavisd tmp folder...
Sep  2 12:57:46 mail systemd: Starting Clean amavisd quarantine folder...
Sep  2 12:57:46 mail systemd: Started Clean amavisd tmp folder.
Sep  2 12:57:46 mail systemd: Started Clean amavisd quarantine folder.
Sep  3 00:37:50 mail systemd: Stopped Amavisd clean tmp timer.
Sep  3 00:37:50 mail systemd: Stopped Amavisd clean quarantine timer.
Sep  3 00:37:50 mail yum[29647]: Erased: amavisd-new-2.11.1-1.el7.noarch

That last line in the log was yum removing the amavisd-new package. Wtf yum?

I'm using the yum-cron service to automatically update packages to help me keep on top of bug fixes and critical vulnerabilities, and I suspect you are using it as well. Here's more information:

root@mail:/var/log
$ yum install amavisd-new
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: centos.s.uw.edu
 * epel: d2lzkl7pfhq30w.cloudfront.net
 * extras: centos.s.uw.edu
 * updates: mirror.cs.uwp.edu
Package amavisd-new-2.11.1-1.el7.noarch is obsoleted by amavis-2.12.0-9.el7.noarch which is already installed
Nothing to do

So it appears yum-cron obsoleted our amavisd-new package and replaced it with a different package; amavis-2.12.0-9.el7

The final fix for my issue was to enable amavisd and start it.

root@mail:/var/log
$ systemctl enable amavisd
root@mail:/var/log
$ systemctl start amavisd

I hope this helps.

3

Re: Amavisd dead itself

Yes, same situation and same results for me.

# cat /var/log/yum.log | grep amavis
Sep 03 12:53:08 Installed: amavis-2.12.0-9.el7.noarch
Sep 03 12:53:08 Erased: amavisd-new-2.11.1-1.el7.noarch

New package "amavis" was installed by 'yum update' process, and older  "amavisd-new" was removed.

*BUT* new service "amavis" was not started, and was not set to start at boot, so shutdown and restart which I do always when core services are updated, didn't work to start mailq flow !?!? 

I think Mr. Zhang will check what happened in next days.

4

Re: Amavisd dead itself

It's a known issue caused by the new "amavis" package. I think it's a bug made by the package maintainer. sad

5

Re: Amavisd dead itself

Hi,

Just wanna let you know that we still had this issue yesterday.
Any suggestion to detect and automatically restarting amavisd dead service ?

Thanks

6

Re: Amavisd dead itself

The problem is why amavisd is dead?

7

Re: Amavisd dead itself

yes

8

Re: Amavisd dead itself

Finally found the solution.

For whatever reason, the service is disabled so you need to re-enabled it with this command:

systemctl enable amavisd.service

Best regards,
Donavan