After installation with no error, amavisd is not running

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
sterua
Posts: 6
Joined: Thu Feb 26, 2015 1:41 am

After installation with no error, amavisd is not running

Post by sterua »

Hello All.
It's been few hours i seek how to start amavisd but i dont find how.

I've installed zcs 8.8.15.GA.3847.UBUNTU18.64 UBUNTU18_64 on ubuntu 18.04

in my server, i've install dnsmasq with the configuration (i've replace my domain name by mydomain.com and my public ip by xx.xx.xx.xx) :

Code: Select all

server=8.8.8.8
server=8.8.6.6
listen-address=127.0.0.1
domain=mydomain.com
#address=/mydomain.com/127.0.0.1
#address=/mydomain.com/XX.XX.XX.XX
mx-host=mydomain.com,mydomain.com,5
my /etc/hosts is :

Code: Select all

127.0.0.1 localhost.mydomain.com       localhost
127.0.0.1 mydomain.com myhost
xx.xx.xx.xx mydomain.com mydomain.com
i also disable ipv6

no error during installation, but, amavis, antispam and antivirus don't start

when i try to restart service or just start zmamavisctl, i've got his in the log :

Code: Select all

Sep  6 10:04:36 mydomain amavis[1027]: starting. /opt/zimbra/common/sbin/amavisd at mydomain.com amavisd-new-2.10.1 (20141025), Unicode aware, LANG="fr_FR.UTF-8"
Sep  6 10:04:36 mydomain amavis-services[22304]: childproc_minder: FLUSH process states
Sep  6 10:04:36 mydomain amavis-services[22305]: snmp_responder: FLUSH snmp data
Sep  6 10:04:36 mydomain amavis[1027]: perl=5.026001, user=999, EUID: 999 (999);  group=, EGID: 999 5 998 999 (999 5 998 999)
Sep  6 10:04:36 mydomain amavis[1027]: SpamControl: init_pre_chroot on SpamAssassin done
Sep  6 10:04:36 mydomain amavis[1040]: Net::Server: Process Backgrounded
Sep  6 10:04:36 mydomain amavis[1040]: Net::Server: 2019/09/06-10:04:36 Amavis (type Net::Server::PreForkSimple) starting! pid(1040)
Sep  6 10:04:36 mydomain amavis[1040]: Net::Server: Binding to UNIX socket file "/opt/zimbra/data/amavisd/amavisd.sock"
Sep  6 10:04:36 mydomain amavis[1040]: Net::Server: Binding to TCP port 10024 on host 127.0.0.1 with IPv4
Sep  6 10:04:36 mydomain amavis[1040]: (!)Net::Server: 2019/09/06-10:04:36 Can't connect to TCP port 10024 on 127.0.0.1 [Address already in use]\n  at line 64 in file /opt/zimbra/common/lib/perl5/Net/Server/Proto/TCP.pm
Sep  6 10:04:36 mydomain amavis[1040]: Net::Server: 2019/09/06-10:04:36 Server closing!
Can someone help me please ? (sorry for my english)
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 889
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: After installation with no error, amavisd is not running

Post by JDunphy »

sterua wrote:Hello All.
It's been few hours i seek how to start amavisd but i dont find how.

I've installed zcs 8.8.15.GA.3847.UBUNTU18.64 UBUNTU18_64 on ubuntu 18.04

Sep 6 10:04:36 mydomain amavis[1040]: Net::Server: Binding to TCP port 10024 on host 127.0.0.1 with IPv4
Sep 6 10:04:36 mydomain amavis[1040]: (!)Net::Server: 2019/09/06-10:04:36 Can't connect to TCP port 10024 on 127.0.0.1 [Address already in use]\n at line 64 in file /opt/zimbra/common/lib/perl5/Net/Server/Proto/TCP.pm
Sep 6 10:04:36 mydomain amavis[1040]: Net::Server: 2019/09/06-10:04:36 Server closing![/code]

Can someone help me please ? (sorry for my english)
Make sure you don't have any old amavis running... Error message above says you do because a process is already bound to that port 10024 and in listen mode. A few ways to verify this.

Code: Select all

# su - zimbra
% zmamavisdctl status
amavisd is running.
amavisd-mc is running.
% ps axo pid,command |grep master |grep amavi
19909 /opt/zimbra/common/sbin/amavisd (master)
% zmamavisdctl stop  
Stopping amavisd... done.
Stopping amavisd-mc... done.
% ps axo pid,command |grep master |grep amavi
% zmamavisdctl status
amavisd is not running.
% zmamavisdctl start
Starting amavisd-mc...done.
Starting amavisd...done.
or work backwards from the socket 10024 to see what programs are running that are listening on this port and kill them. Note: kill -TERM should be enough to the master amavis but don't try to start until you can verify that you don't have anything listening on port 10024

Code: Select all

% su -
# lsof -i :10024
COMMAND   PID   USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
amavisd   696 zimbra    4u  IPv4 370675540      0t0  TCP localhost:10024 (LISTEN)
amavisd   764 zimbra    4u  IPv4 370675540      0t0  TCP localhost:10024 (LISTEN)
amavisd  2586 zimbra    4u  IPv4 370675540      0t0  TCP localhost:10024 (LISTEN)
amavisd  2646 zimbra    4u  IPv4 370675540      0t0  TCP localhost:10024 (LISTEN)
amavisd 26670 zimbra    4u  IPv4 370675540      0t0  TCP localhost:10024 (LISTEN)
...

# su - zimbra
% zmamavisdctl start
sterua
Posts: 6
Joined: Thu Feb 26, 2015 1:41 am

Re: After installation with no error, amavisd is not running

Post by sterua »

thanks a lot, JDunphy, it works !!!!! but just until reboot ...
i've akready try stop et restart zmamavisctl but i had not have ths lsof command.
so, now, when i reboot, i do zmcontrol status, and i have :

Code: Select all

Host mydomain.com
        amavis                  Stopped
                amavisd is not running.
        antispam                Stopped
                zmamavisdctl is not running
        antivirus               Stopped
                zmamavisdctl is not running
                zmclamdctl is not running
                zmfreshclamctl is not running
        convertd                Running
        ldap                    Running
        logger                  Running
        mailbox                 Running
        memcached               Running
        mta                     Stopped
                zmsaslauthdctl is not running
                postfix is not running
        opendkim                Stopped
                zmopendkimctl is not running.
        proxy                   Running
        service webapp          Running
        snmp                    Stopped
                zmswatch is not running.
        spell                   Stopped
                zmapachectl is not running
        stats                   Stopped
        zimbra webapp           Running
        zimbraAdmin webapp      Running
        zimlet webapp           Running
        zmconfigd               Running
so, i do a zmcontrol restart and zmcontrol status after:

Code: Select all

~$ zmcontrol restart
Host mydomain.com
        Stopping vmware-ha...Done.
        Stopping zmconfigd...Done.
        Stopping zimlet webapp...Done.
        Stopping zimbraAdmin webapp...Done.
        Stopping zimbra webapp...Done.
        Stopping service webapp...Done.
        Stopping stats...Done.
        Stopping mta...Done.
        Stopping spell...Done.
        Stopping snmp...Done.
        Stopping cbpolicyd...Done.
        Stopping archiving...Done.
        Stopping opendkim...Done.
        Stopping amavis...Done.
        Stopping antivirus...Done.
        Stopping antispam...Done.
        Stopping proxy...Done.
        Stopping memcached...Done.
        Stopping mailbox...Done.
        Stopping convertd...Done.
        Stopping logger...Done.
        Stopping dnscache...Done.
        Stopping ldap...Done.
Host mydomain.com
        Starting ldap...Done.
        Starting zmconfigd...Done.
        Starting logger...Done.
        Starting convertd...Done.
        Starting mailbox...Done.
        Starting memcached...Done.
        Starting proxy...Done.
        Starting amavis...Done.
        Starting antispam...Done.
        Starting antivirus...Done.
        Starting opendkim...Done.
        Starting snmp...Done.
        Starting spell...Done.
        Starting mta...Done.
        Starting stats...Done.
        Starting service webapp...Done.
        Starting zimbra webapp...Done.
        Starting zimbraAdmin webapp...Done.
        Starting zimlet webapp...Done.
zimbra@host:~$ zmcontrol status
Host mydomain.com
        amavis                  Stopped
                amavisd is not running.
        antispam                Stopped
                zmamavisdctl is not running
        antivirus               Stopped
                zmamavisdctl is not running
        convertd                Running
        ldap                    Running
        logger                  Running
        mailbox                 Running
        memcached               Running
        mta                     Running
        opendkim                Running
        proxy                   Running
        service webapp          Running
        snmp                    Running
        spell                   Running
        stats                   Running
        zimbra webapp           Running
        zimbraAdmin webapp      Running
        zimlet webapp           Running
        zmconfigd               Running
i do work, after that, i do : zmamavisdctl stop
after, with root login, i do lsof -i :10024 and a kill -9 of all pid shown.
For ending, i do a zmamavisdctl start as zimbra user, and all service are running ...

Code: Select all

zimbra@host:~$ zmamavisdctl stop
zimbra@host:~$ exit
root@host:~# lsof -i :10024
COMMAND    PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
/usr/sbin 2126 amavis    5u  IPv4  30600      0t0  TCP localhost.condateam.com:10024 (LISTEN)
/usr/sbin 2178 amavis    5u  IPv4  30600      0t0  TCP localhost.condateam.com:10024 (LISTEN)
/usr/sbin 2179 amavis    5u  IPv4  30600      0t0  TCP localhost.condateam.com:10024 (LISTEN)
root@host:~# kill 2126 2178 2179
root@host:~# su - zimbra
zimbra@host:~$ zmamavisdctl start
Starting amavisd-mc...done.
Starting amavisd...Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/^(.{ <-- HERE ,200}).*$/ at /opt/zimbra/common/lib/perl5/Mail/SpamAssassin/PerMsgStatus.pm line 921, <DATA> line 755.
done.
zimbra@host:~$ zmcontrol status
Host mydomain.com
        amavis                  Running
        antispam                Running
        antivirus               Running
        convertd                Running
        ldap                    Running
        logger                  Running
        mailbox                 Running
        memcached               Running
        mta                     Running
        opendkim                Running
        proxy                   Running
        service webapp          Running
        snmp                    Running
        spell                   Running
        stats                   Running
        zimbra webapp           Running
        zimbraAdmin webapp      Running
        zimlet webapp           Running
        zmconfigd               Running
So why do i have to do this for all service running? how can i fix it for all services working at reboot ?
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 889
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: After installation with no error, amavisd is not running

Post by JDunphy »

Hello,

Pretty interesting problem. You have a lot of things going on including the topic of amavisd given what you have posted.

Can you verify what you are attempting to start on reboot. I would be looking for non zimbra things. I am not running ubuntu 18 or anything systemd related but I think you want to do something like:

Code: Select all

$ systemctl list-dependencies
Maybe someone who is running 8.8.15 and Ubuntu 18+ can chime in and help here.

You are looking to see if you are attempting to start non zimbra postfix or non zimbra amavis, etc, etc. It's a fairly common problem for admins coming to zimbra to forget they have previous configurations of postfix installed or other programs that are included with zimbra... You want to disable those non zimbra versions if that applies to you. I would start there. Once you have that ruled out, the next step is to look at some load issues because some of these start scripts have sleep and a severely slow machine could throw off their ability to test if the daemon came up and those start scripts could end early as a result. Next look at memory and dmesg to see if the kernel is killing processes because of shortfalls. If you don't have any swap configured then the kernel will do its best to kill off processes to help with memory shortfalls.

Also /var/log/zimbra.log should have a lot of information of what happened when you did your reboot that may help isolate the problem.

It isn't common to have any of the issues you are reporting so you should expect to have a clean reboot and have zimbra come up clean. Unfortunately, I don't have enough of a picture of what is going on to identify the root cause.

Jim
Slava
Posts: 3
Joined: Fri Aug 23, 2019 9:42 am

Re: After installation with no error, amavisd is not running

Post by Slava »

Good morning!

I also had a problem 8.8.15.GA.3847.UBUNTU18.64 if disabling IPv6


If you use the /etc/sysctl.conf method, then
( WARNING: Please note, that at the time of writing this method to disable IPv6 after reboot using /etc/sysctl.conf configuration file on Ubuntu 18.04 does Not work. However, this seems to be a bug so feel free to try.)

I disabled IPv6: The recommend method to disable IPv6 on Ubuntu 18.04 after reboot is to configure the GRUB boot loader to pass kernel parameter during the boot time.

after that the error with Amavisd disappeared
phoenix
Ambassador
Ambassador
Posts: 27272
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: After installation with no error, amavisd is not running

Post by phoenix »

sterua wrote:my /etc/hosts is :

Code: Select all

127.0.0.1 localhost.mydomain.com       localhost
127.0.0.1 mydomain.com myhost
xx.xx.xx.xx mydomain.com mydomain.com
That hosts file is incorrect, it's been covered many times in these forums and it's even covered in a wiki article. The correct format is as follows:

Code: Select all

127.0.0.1 localhost.localdomain localhost
xx.xx.xx.xx    mail.yourdomain.com mail
i.e. the FQDN of the server needs to be specified in there, both of those line should be as I've shown.

You should also not need to disable IPv6 on your server, it works fine for me on CentOS7. Leave IPv6 enabled, fix the hosts file and see how you get on with that.
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
sterua
Posts: 6
Joined: Thu Feb 26, 2015 1:41 am

Re: After installation with no error, amavisd is not running

Post by sterua »

Actually, i dont know why, but, i haves install amavisd-new, so, i remove it, and all things are now ok, all services started at boot;)
I'd like to mark the subject as resolved... but i dont know how
phoenix
Ambassador
Ambassador
Posts: 27272
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: After installation with no error, amavisd is not running

Post by phoenix »

sterua wrote:Actually, i dont know why, but, i haves install amavisd-new, so, i remove it, and all things are now ok, all services started at boot;)
I'd like to mark the subject as resolved... but i dont know how
You can do that by editing your first post and changing the title.

You still need to modify your hosts file as per the details in my previous post as it is incorrectly configured.
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
User avatar
L. Mark Stone
Ambassador
Ambassador
Posts: 2796
Joined: Wed Oct 09, 2013 11:35 am
Location: Portland, Maine, US
ZCS/ZD Version: 10.0.6 Network Edition
Contact:

Re: After installation with no error, amavisd is not running

Post by L. Mark Stone »

I just reproduced this on Ubuntu 18, Zimbra 8.8.15 Patch 6 + Hotfix.

The issue is due to having removed IPv6 from the Ubuntu 18.04 server using the Ubuntu 16.04 method.

It used to be that adding the following lines to the bottom of /etc/sysctl.conf was enough. And it was, for 16.04. But not necessarily for 18.04.

Code: Select all

# Turn off IPv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
# Name the NIC explicitly; seems to be required on Ubuntu 18:
net.ipv6.conf.ens5.disable_ipv6 = 1
# Reduce Swappiness
vm.swappiness = 1
Then after a reboot or a "sysctl -p", when Amavis tries to start on 18.04 you may see in /var/log/zimbra.log:

Code: Select all

Feb  3 16:35:08 mark1 amavis[24123]: Net::Server: 2020/02/03-16:35:08 Amavis (type Net::Server::PreForkSimple) starting! pid(24123)
Feb  3 16:35:08 mark1 amavis[24123]: Net::Server: Binding to UNIX socket file "/opt/zimbra/data/amavisd/amavisd.sock"
Feb  3 16:35:08 mark1 amavis[24123]: Net::Server: Binding to TCP port 10024 on host 127.0.0.1 with IPv4
Feb  3 16:35:08 mark1 amavis[24123]: Net::Server: Binding to TCP port 10024 on host ::1 with IPv6
Feb  3 16:35:08 mark1 amavis[24123]: (!)Net::Server: 2020/02/03-16:35:08 Can't connect to TCP port 10024 on ::1 [Cannot assign requested address]\n  at line 64 in file /opt/zimbra/common/lib/perl5/Net/Server/Proto/TCP.pm
Feb  3 16:35:08 mark1 amavis[24123]: Net::Server: 2020/02/03-16:35:08 Server closing!

The trick it seems for some rolls of Ubuntu 18.04 is to edit /etc/default/grub, with the following changes, and then reboot.

Code: Select all

# 3 February 2020 - Original  two lines below. Need to add "ipv6.disable=1" to fully disable IPv6.
# See https://askubuntu.com/questions/1046057/disabling-ipv6-in-ubuntu-server-18-04
# GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
# GRUB_CMDLINE_LINUX=""
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1"
GRUB_CMDLINE_LINUX="ipv6.disable=1"
After that, IPv6 will be completely removed from the system, and you won't have this error.

Hope that helps,
Mark
___________________________________
L. Mark Stone
Mission Critical Email - Zimbra VAR/BSP/Training Partner https://www.missioncriticalemail.com/
AWS Certified Solutions Architect-Associate
hisfran
Posts: 31
Joined: Tue Apr 29, 2014 2:10 pm

Re: After installation with no error, amavisd is not running

Post by hisfran »

This did not work for me initially as I did not have this line in /etc/sysctl.conf
# Name the NIC explicitly; seems to be required on Ubuntu 18:
net.ipv6.conf.ens18.disable_ipv6 = 1

After adding this line, doing sysctl -p and zmamavisdctl restart amavis was listed as Running.


Before the above, the alternative solution I found was this:

Edit /opt/zimbra/conf/amavisd.conf.in

add this line:
$inet_socket_bind = '127.0.0.1';

Restart zimbra amavis:
zmamavisdctl restart

Et Voila!
:)
Post Reply