启动后无法打开 PID 文件 /run/dovecot/master.pid(还?

Can't open PID file /run/dovecot/master.pid (yet?) after start: No such file or directory

提问人:Lucian Curteanu 提问时间:9/6/2023 更新时间:9/6/2023 访问量:148

问:

转到 dovecot.service,在 [Service] 块中 Type=forking 后添加此行

ExecStartPost=/bin/sh -c 'chown root:dovecot /var/run/dovecot/master.pid' 

然后运行 cmd

systemctl daemon-reload && systemctl restart dovecot && systemctl status dovecot

鸽舍状态应如下所示:

dovecot.service - Dovecot IMAP/POP3 email server
   Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2023-09-06 15:37:23 BST; 38ms ago
     Docs: man:dovecot(1)
           http://wiki2.dovecot.org/
  Process: 18381 ExecStop=/usr/bin/doveadm stop (code=exited, status=0/SUCCESS)
  Process: 18396 ExecStartPost=/bin/sh -c chown root:dovecot /var/run/dovecot/master.pid (code=exited, status=0/SUCCESS)
  Process: 18393 ExecStart=/usr/sbin/dovecot (code=exited, status=0/SUCCESS)
  Process: 18391 ExecStartPre=/usr/sbin/portrelease dovecot (code=exited, status=0/SUCCESS)
  Process: 18385 ExecStartPre=/usr/libexec/dovecot/prestartscript (code=exited, status=0/SUCCESS)
 Main PID: 18395 (dovecot)
   CGroup: /system.slice/dovecot.service
           ├─18395 /usr/sbin/dovecot
           ├─18398 dovecot/anvil
           ├─18399 dovecot/log
           ├─18400 dovecot/ssl-params
           └─18403 dovecot/config

Sep 06 15:37:23 domain.com systemd[1]: Stopped Dovecot IMAP/POP3 email server.
Sep 06 15:37:23 domain.com systemd[1]: Starting Dovecot IMAP/POP3 email server...
Sep 06 15:37:23 domain.com dovecot[18395]: master: Dovecot v2.2.36 (1f10bfa63) starting up for imap, pop3, lmtp (core dumps disabled)
Sep 06 15:37:23 domain.com systemd[1]: Started Dovecot IMAP/POP3 email server.
type here
Linux CentOS 鸽舍

评论

0赞 asat 10/21/2023
我在 CentOs 7 上遇到了同样的问题,在 OpenVZ 上运行,您的修复程序对我有用。

答: 暂无答案