View Issue Details

IDProjectCategoryView StatusLast Update
0013323CentOS-7postfixpublic2020-08-23 01:24
ReporterSteve Nash Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version7.3.1611 
Summary0013323: Postfix fails to start on reboot when inet_interfaces set to specific interfaces.
DescriptionPostfix fails to start on reboot when inet_interfaces set to specific interfaces. If you then login you can manually start postfix as all network interfaces are up at that point.
Steps To ReproduceIn main.cf:
inet_interfaces = localhost, smtp.example.org

Reboot
Additional InformationLooking through /var/log/messages it seems postfix is starting after the loopback interface but before eth0.

A workaround is to change main.cf to:
inet_interfaces = all

Whilst this works it isn't always desirable to bind postfix to all interfaces.

Looking at the postfix systemd configuration I believe postfix should not try starting until all network interfaces are up.

Log example:
May 26 12:08:32 mail network: Bringing up loopback interface: [ OK ]
May 26 12:08:33 mail systemd: postfix.service: control process exited, code=exited status=1
May 26 12:08:33 mail systemd: Failed to start Postfix Mail Transport Agent.
May 26 12:08:33 mail systemd: Unit postfix.service entered failed state.
May 26 12:08:33 mail systemd: postfix.service failed.
May 26 12:08:33 mail kernel: hv_netvsc vmbus_15: net device safe to remove
May 26 12:08:33 mail kernel: hv_netvsc: hv_netvsc channel opened successfully
May 26 12:08:33 mail systemd: Started MariaDB database server.
May 26 12:08:33 mail kernel: hv_netvsc vmbus_15: Send section size: 6144, Section count:2560
May 26 12:08:33 mail kernel: hv_netvsc vmbus_15: Device MAC 00:1d:db:b7:1d:77 link state up
May 26 12:08:33 mail kernel: bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
May 26 12:08:33 mail kernel: Netfilter messages via NETLINK v0.30.
May 26 12:08:33 mail kernel: ip_set: protocol 6
May 26 12:08:33 mail systemd: Time has been changed
....
May 26 12:08:44 mail network: Bringing up interface eth0: [ OK ]
Tags"restarting system"
abrt_hash
URL

Activities

kabe

kabe

2017-06-02 02:20

reporter   ~0029390

I cannot reproduce this, but symptom seems similar as in

sshd.service fails start during boot if ListenAddress directive is used
https://bugs.centos.org/view.php?id=13146

Proposed workaround:
Add systemd config to start postfix after network.online target.


Add a new file /etc/systemd/system/postfix.service.d/online.conf :
===
[Unit]
After=network-online.target
===
then do "systemctl daemon-reload", and reboot.


Since this config file is out of RPM administration, it should survive yum updates.

If /var/log/messages shows invocation order of
Jun 2 11:14:46 UEFI73 systemd: Reached target Network is Online.
Jun 2 11:14:46 UEFI73 systemd: Starting Postfix Mail Transport Agent...

then the workaround is working.
kochin

kochin

2020-07-22 14:01

reporter   ~0037393

@kabe
Thank you for providing the workaround.
I'm running CentOS 8 and still having the issue with Postfix failing at startup. Just applied your workaround then restarted. And, voilĂ , no more Postfix failure.
It's actually quite reasonable that Postfix shouldn't start until network is completely online.
fulmerwil

fulmerwil

2020-08-23 01:24

reporter   ~0037584

@kabe
Like @kochin, I also had problems with postfix starting at boot time under CentOS 8. You're solution resolves the issue.

Issue History

Date Modified Username Field Change
2017-05-28 13:14 Steve Nash New Issue
2017-05-28 13:14 Steve Nash Tag Attached: "restarting system"
2017-06-02 02:20 kabe Note Added: 0029390
2020-07-22 14:01 kochin Note Added: 0037393
2020-08-23 01:24 fulmerwil Note Added: 0037584