Postfix 启动失败:无法设置排他锁:资源暂时不可用

Fah*_*had 2 postfix centos7

Postfix 运行良好,直到我因某种原因决定重新启动,因为我更新了message_size_limit

通过做这个

postconf -e message_size_limit=24840000

停止它,现在...... Postfix不会启动,它一直在说

致命:打开锁文件 /var/lib/postfix/master.lock:无法设置排他锁:资源暂时不可用

我尝试恢复更改但没有运气,

Sep 23 20:47:45 example.com systemd[1]: Starting Postfix Mail Transport Agent...
Sep 23 20:47:45 example.com postfix/postfix-script[13392]: starting the Postfix mail system
Sep 23 20:47:45 example.com postfix/master[13394]: fatal: open lock file /var/lib/postfix/master.lock: unable to set exclusive lock: Resource temporarily unavailable
Sep 23 20:47:46 example.com postfix/master[13393]: fatal: daemon initialization failure
Sep 23 20:47:47 example.com postfix/postfix-script[13395]: fatal: mail system startup failed
Sep 23 20:47:47 example.com systemd[1]: postfix.service: control process exited, code=exited status=1
Sep 23 20:47:47 example.com systemd[1]: Failed to start Postfix Mail Transport Agent.
Sep 23 20:47:47 example.com systemd[1]: Unit postfix.service entered failed state.
Sep 23 20:47:47 example.com systemd[1]: postfix.service failed.
Run Code Online (Sandbox Code Playgroud)

如果有帮助,我也在两周前从LetsEncrypt安装了 SSL ,也许这可能是问题的原因?

Fah*_*had 15

感谢与@ryan-babchishin共享的URL,它有助于找到解决方案

##问题所以我使用systemctl来启动、重新加载、停止 postfix 并且它正在添加其他隐藏用户,我最近更新了virtualmin,并且它一直在使用

#systemctl status postfix.service
#systemctl stop postfix.service
#systemctl start postfix.service
Run Code Online (Sandbox Code Playgroud)

代替

#postfix <start/stop>
Run Code Online (Sandbox Code Playgroud)

##解决方案所以导致master.lock被其他用户使用因此我们无法修改,导致

致命:邮件系统启动失败

我们只需要杀死进程启动postfix

现在...检查文件是否在那里

#ls -l /var/lib/postfix/master.lock
Run Code Online (Sandbox Code Playgroud)

寻找利用它的过程

#htop 
Run Code Online (Sandbox Code Playgroud)

或者干脆做

#fuser /var/lib/postfix/master.lock
7881
Run Code Online (Sandbox Code Playgroud)

现在

#ps -ef | grep 7881
root      7881     1  0 Sep16 ?        00:00:09 /usr/libexec/postfix/master -w
postfix   9127  7881  0 10:04 ?        00:00:00 pickup -l -t unix -u
postfix   9469  7881  0 10:13 ?        00:00:00 smtpd -n smtp -t inet -u -o stress= -o smtpd_sasl_auth_enable=yes
postfix   9470  7881  0 10:13 ?        00:00:00 proxymap -t unix -u
postfix   9471  7881  0 10:13 ?        00:00:00 smtpd -n smtp -t inet -u -o stress= -o smtpd_sasl_auth_enable=yes
postfix   9472  7881  0 10:13 ?        00:00:00 anvil -l -t unix -u
postfix   9476  7881  0 10:13 ?        00:00:00 trivial-rewrite -n rewrite -t unix -u
root      9486  8671  0 10:13 pts/0    00:00:00 grep --color=auto 7881
postfix  28581  7881  0 Sep17 ?        00:00:01 qmgr -l -t unix -u
Run Code Online (Sandbox Code Playgroud)

找到使用锁文件的进程

杀死进程

#kill 7881
Run Code Online (Sandbox Code Playgroud)

现在让我们回到 postfix

# postfix status
postfix/postfix-script: the Postfix mail system is not running
Run Code Online (Sandbox Code Playgroud)

现在开始吧

# postfix start
postfix/postfix-script: starting the Postfix mail system
Run Code Online (Sandbox Code Playgroud)

Postfix 又开始运行了!

让我在 Android上玩Sticky Bubble来放松一下 :)