启动时日志:“无法启动 Postfix 邮件传输代理”

启动时日志:“无法启动 Postfix 邮件传输代理”

centos 7.1
postfix 2.10.1

重启服务器后/var/log/消息在启动过程中,Postfix 仅记录了以下 4 行(1 秒内的所有操作):

systemd: Starting Postfix Mail Transport Agent...
systemd: postfix.service: control process exited, code=exited status=1
systemd: Failed to start Postfix Mail Transport Agent.
systemd: Unit postfix.service entered failed state.

同时(同一秒内)/var/log/邮件日志仅一行:

postfix/postfix-script[2069]: fatal: the Postfix mail system is already running

1). 在哪里可以找到有关此错误的更多信息?
2). 如何实现已经开始如果在此之前的系统日志中没有任何关于 Postfix 的记录?

更新
如果我手动运行 Postfix - 一切都很完美!问题只出现在启动时。

systemctl 启动 postfix
journalctl-xe

May 30 17:41:58 CentOS-70-64-minimal systemd[1]: Starting Postfix Mail Transport Agent...
-- Subject: Unit postfix.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit postfix.service has begun starting up.
May 30 17:41:59 CentOS-70-64-minimal postfix/postfix-script[6524]: starting the Postfix mail system
May 30 17:41:59 CentOS-70-64-minimal postfix/master[6526]: daemon started -- version 2.10.1, configuration /etc/postfix
May 30 17:41:59 CentOS-70-64-minimal systemd[1]: Started Postfix Mail Transport Agent.
-- Subject: Unit postfix.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit postfix.service has finished starting up.
-- 
-- The start-up result is done.
May 30 17:42:06 CentOS-70-64-minimal postfix/postfix-script[6538]: the Postfix mail system is running: PID: 6526

更新2

哇,最后并不完美......我尝试发送电子邮件:

php -a
mail('[email protected]','subject','text');

并出现错误。

/var/log/邮件日志

May 30 17:41:59  postfix/postfix-script[6524]: starting the Postfix mail system
May 30 17:41:59  postfix/master[6526]: daemon started -- version 2.10.1, configuration /etc/postfix
May 30 17:42:06  postfix/postfix-script[6538]: the Postfix mail system is running: PID: 6526
May 30 17:51:35  postfix/pickup[6527]: A4DC31180305: uid=0 from=<root>
May 30 17:51:35  postfix/cleanup[6554]: A4DC31180305: message-id=<[email protected]>
May 30 17:51:35  postfix/qmgr[6528]: A4DC31180305: from=<[email protected]>, size=411, nrcpt=2 (queue active)
May 30 17:51:35  postfix/smtp[6556]: fatal: open lock file pid/unix.smtp: cannot open file: Permission denied
May 30 17:51:35  postfix/cleanup[6554]: C483211802E1: message-id=<[email protected]>
May 30 17:51:35  postfix/qmgr[6528]: C483211802E1: from=<[email protected]>, size=579, nrcpt=1 (queue active)
May 30 17:51:35  postfix/local[6557]: A4DC31180305: to=<[email protected]>, relay=local, delay=0.28, delays=0.17/0.04/0/0.07, dsn=2.0.0, status=sent (forwarded as C483211802E1)
May 30 17:51:36  postfix/master[6526]: warning: process /usr/libexec/postfix/smtp pid 6556 exit status 1
May 30 17:51:36  postfix/master[6526]: warning: /usr/libexec/postfix/smtp: bad command startup -- throttling
May 30 17:52:36  postfix/smtp[6558]: fatal: open lock file pid/unix.smtp: cannot open file: Permission denied

netstat -nlap |复制代码

tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      6526/master

后缀状态

postfix/postfix-script: the Postfix mail system is running: PID: 6526

更新 3

又是美好的一天!
系统中出现了一些不明显且奇怪的东西 :)
我没有更改任何设置,再次重新启动服务器,发现一切正常。
只需输入两行/var/log/消息在启动过程中,Postfix 就会启动:

systemd: Starting Postfix Mail Transport Agent...
systemd: Started Postfix Mail Transport Agent.

谢谢你的建议!!

答案1

对于第二个问题:自服务启动以来,日志文件可能已经轮换(意味着日志现在位于其他文件中)。

对于这个问题:有可能“已经开始”消息可能具有误导性:通常,从服务器进程退出而未完全关闭其侦听的套接字/端口到另一个服务器实例可以成功绑定并侦听同一端口,这需要相当长的时间(几十秒)。我认为该消息可能只是指示此类绑定失败(如果另一个服务器实例确实仍在运行)。

我会检查另一个实例是否实际正在运行,如果没有,则再次尝试启动该服务。

一般来说,我建议停止一项服务,等待一段时间然后启动它(而不是简单地重新启动它),除非该服务明确支持正常重启。

相关内容