prevent overlapping postfix services

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
rotorboy
Advanced member
Advanced member
Posts: 169
Joined: Fri Sep 12, 2014 11:24 pm

prevent overlapping postfix services

Post by rotorboy »

Greetings,

We had that very annoying situation where what should have been a simple server shutdown, switch power source, server start-up resulted in an hour of frustration. Somewhere between the last time we rebooted this Zimbra server and today CentOS decided to re-add postfix to it's start-up list so that when Zimbra tries to start postfix properly it finds the port is already bound and in use.
Jan 13 08:20:24 zimbra postfix/master[15322]: fatal: bind 0.0.0.0 port 25: Address already in use
So we have to check to see what's listening on port 25

Code: Select all

[root@zimbra ~]# netstat -lnp |grep :25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1932/master
tcp6 0 0 ::1:25 :::* LISTEN 1932/master
[root@zimbra ~]# ps -ef | grep 1932
root 1932 1 0 08:09 ? 00:00:00 /usr/libexec/postfix/master -w
postfix 1977 1932 0 08:09 ? 00:00:00 pickup -l -t unix -u
postfix 1978 1932 0 08:09 ? 00:00:00 qmgr -l -t unix -u
root 30599 4741 0 08:35 pts/0 00:00:00 grep --color=auto 1932
And then we shut down postfix

Code: Select all

systemctl stop postfix.service
Next we restart the mta (and make sure everything else is running)

Code: Select all

/etc/init.d/zimbra start
Host zimbra.servername.com
Starting zmconfigd...Done.
Starting dnscache...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.
Next is to disable it from starting up automatically

Code: Select all

systemctl disable postfix
Removed symlink /etc/systemd/system/multi-user.target.wants/postfix.service.
How do we make CentOS 7 never re-enable postfix?

Perhaps a solution might be for the Zimbra start-up script (in /etc/init.d/zimbra) to be modified to first try and shut down any existing postfix services before it starts it's own services?
User avatar
DualBoot
Elite member
Elite member
Posts: 1326
Joined: Mon Apr 18, 2016 8:18 pm
Location: France - Earth
ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
Contact:

Re: prevent overlapping postfix services

Post by DualBoot »

Hello,

best solution is to have a minimal CentOS installation and purge the Postfix package.
I have already encounter this kind of problem with chkconfig, each time there was
an update of postfix, it re-enabled the postfix service.
Another solution it is to point the Postfix Unit in Systemd to the Zimbra Postfix binary ?

Regards,
FredKarno
Posts: 49
Joined: Sat Oct 10, 2015 5:40 am

Re: prevent overlapping postfix services

Post by FredKarno »

DualBoot - I have the exact same config and issue. Could you possibly expand on your answer? I'm not as good at Centos as rotorboy so I have to find and kill the postfix that claims port 25 after each reboot :(

Thank you
phoenix
Ambassador
Ambassador
Posts: 27272
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: prevent overlapping postfix services

Post by phoenix »

FredKarno wrote:DualBoot - I have the exact same config and issue. Could you possibly expand on your answer? I'm not as good at Centos as rotorboy so I have to find and kill the postfix that claims port 25 after each reboot (
The following will get rid of it:

Code: Select all

yum remove postfix
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
FredKarno
Posts: 49
Joined: Sat Oct 10, 2015 5:40 am

Re: prevent overlapping postfix services

Post by FredKarno »

lol, so simple :)
And this won't affect Zimbra's use of Postfix? If Zimbra installs its own postfix then great but I'm very nervous of zapping anything that Zimbra might use...
The reason I'm a bit freaked out is this thread where you said to disable it instead
viewtopic.php?t=57279
but I guess that's quite old now and you're the perfect person to answer the question! :)
Thanks again
phoenix
Ambassador
Ambassador
Posts: 27272
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Re: prevent overlapping postfix services

Post by phoenix »

Sorry for the late reply to this. :( Both of my answers are correct. The first time a gave that answer there were some system system dependencies (nothing to do with Zimbra) that would not allow it to be removed and the answer I gave you is also correct on the date I posted it as there were no dependencies when I removed postfix. So, the answer is try to 'remove' and if it complains then don't remove it and just run "systemctl disable postfix" to stop it being started.
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
Post Reply