Postfix只在“systemctl守护进程重新加载”之后启动

今天我升级了Postfix,一切正常,直到我决定让服务器重启,看看是否所有的东西都恢复了。

一切都很好,但systemd似乎“忽略”后缀启动:

Oct 7 22:59:25 [REDACTED] systemd[1]: Stopped Postfix Mail Transport Agent. Oct 7 22:59:25 [REDACTED] systemd[1]: Stopping Postfix Mail Transport Agent... Oct 7 22:59:25 [REDACTED] systemd[1]: Starting Postfix Mail Transport Agent... Oct 7 22:59:25 [REDACTED] systemd[1]: Started Postfix Mail Transport Agent. 

正如你所看到的,它没有显示Postfix的启动 ,预计会是这样的:

 postfix: Postfix is running with backwards-compatible default settings postfix: See http://www.postfix.org/COMPATIBILITY_README.html for details postfix: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload" postfix/postfix-script: starting the Postfix mail system 

当我input

 service postfix start 

启动过程进行得太快,并查看进程列表

 ps -ef 

没有列出像皮卡,tlsmgr等任何Postfix服务

现在要解决这个问题,我发现我只需要重新加载systemd

 systemctl daemon-reload 

使用时

 service postfix start 

systemd做它应该是这样的工作:

 Oct 7 23:00:08 [REDACTED] systemd[1]: Reloading. Oct 7 23:00:08 [REDACTED] systemd[1]: apt-daily-upgrade.timer: Adding 15min 23.517714s random time. Oct 7 23:00:08 [REDACTED] systemd[1]: apt-daily.timer: Adding 3h 21min 57.996507s random time. Oct 7 23:00:28 [REDACTED] systemd[1]: Created slice system-postfix.slice. Oct 7 23:00:28 [REDACTED] systemd[1]: Starting Postfix Mail Transport Agent (instance -)... Oct 7 23:00:29 [REDACTED] postfix[1233]: Postfix is running with backwards-compatible default settings Oct 7 23:00:29 [REDACTED] postfix[1233]: See http://www.postfix.org/COMPATIBILITY_README.html for details Oct 7 23:00:29 [REDACTED] postfix[1233]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload" Oct 7 23:00:30 [REDACTED] postfix/postfix-script[1333]: starting the Postfix mail system Oct 7 23:00:30 [REDACTED] postfix/master[1335]: daemon started -- version 3.1.6, configuration /etc/postfix Oct 7 23:00:30 [REDACTED] systemd[1]: Started Postfix Mail Transport Agent (instance -). 

当我重新启动时,我必须重新加载systemd,以便通过服务命令获得Postfix的工作。 这是一个非常奇怪的行为,我还没有在互联网上find任何答案。

系统规格:

CPU: Intel(R)Xeon(R)CPU E5-2670 v3 @ 2.30GHz
内存: 12 GB
SSD: 240 GB
操作系统: Debian 9 Stretch(64位)
所有软件包都是最新的。
使用KVM虚拟化

postfix.service

 [Unit] Description=Postfix Mail Transport Agent Conflicts=sendmail.service exim4.service ConditionPathExists=/etc/postfix/main.cf [Service] Type=oneshot RemainAfterExit=yes ExecStart=/bin/true ExecReload=/bin/true [Install] WantedBy=multi-user.target 

后缀@。服务

 [Unit] Description=Postfix Mail Transport Agent (instance %i) Documentation=man:postfix(1) PartOf=postfix.service Before=postfix.service ReloadPropagatedFrom=postfix.service After=network-online.target nss-lookup.target Wants=network-online.target [Service] Type=forking GuessMainPID=no ExecStartPre=/usr/lib/postfix/configure-instance.sh %i ExecStart=/usr/sbin/postmulti -i %i -p start ExecStop=/usr/sbin/postmulti -i %i -p stop ExecReload=/usr/sbin/postmulti -i %i -p reload [Install] WantedBy=multi-user.target 

我试图解决这个问题

 systemctl enable postfix.service 

但是这也不起作用。

谢谢你的帮助!

编辑:好吧,这很奇怪:“networking”服务无法“提高networking接口”。 但是,当我运行ifconfig IPv4和IPv6接口启动并正常运行。

 Okt 10 20:48:43 [REDACTED] ifup[423]: ifup: failed to bring up eth0 Okt 10 20:48:43 [REDACTED] systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE Okt 10 20:48:43 [REDACTED] systemd[1]: Failed to start Raise network interfaces. Okt 10 20:48:43 [REDACTED] systemd[1]: networking.service: Unit entered failed state. Okt 10 20:48:43 [REDACTED] systemd[1]: networking.service: Failed with result 'exit-code'. 

我已经在14个月前为我的interfaces分配了一次IP,

我也有同样的问题。 从版本9.1升级到版本9.2后,似乎是个bug: https : //bugs.debian.org/cgi-bin/bugreport.cgi? bug =877992

你有没有尝试重新安装后缀? 这对我的系统没有帮助,但也许你有更多的运气。

好的,最终帮助我的是这个简单的命令:

 systemctl enable postfix@- 

重新启动后,一切都开始良好。