未找到作为服务运行的 dovecot 套接字

未找到作为服务运行的 dovecot 套接字

我遇到了一个有关 dovecot 的奇怪问题。我的 dovecot 在我的 cubietruck 上一直运行正常,直到昨天我从 debian/jessie 升级到 debian/stretch (armhf)。
/var符号链接到另一个已安装的驱动器 (mountpoint /extended):/var->/extended/hostname/var

现在,每当我将其作为服务(“ systemctl start dovecot”)启动时,它都不会启动,而是立即退出并出现错误。

May 08 21:16:20 hostname systemd[1]: Starting Dovecot IMAP/POP3 email server...
May 08 21:16:20 hostname dovecot[32167]: Error: bind(/var/spool/postfix/private/auth_dovecot) failed: No such file or directory
May 08 21:16:20 hostname dovecot[32167]: Fatal: Failed to start listeners
May 08 21:16:20 hostname systemd[1]: dovecot.service: Control process exited, code=exited status=89
May 08 21:16:20 hostname systemd[1]: Failed to start Dovecot IMAP/POP3 email server.
May 08 21:16:20 hostname systemd[1]: dovecot.service: Unit entered failed state.
May 08 21:16:20 hostname systemd[1]: dovecot.service: Failed with result 'exit-code'.

root每当我以 shell 形式启动 dovecot 时,dovecot它都不会显示任何错误,而且运行正常。

我的dovecot.conf

auth_mechanisms = plain login
log_timestamp = "%Y-%m-%d %H:%M:%S "
passdb {
  args = /etc/dovecot/dovecot-mysql.conf
  driver = sql
}
protocols = imap pop3
service auth {
  unix_listener /var/spool/postfix/private/auth_dovecot {
    mode = 0660
    user = postfix
    group = postfix
  }
  unix_listener auth-master {
    mode = 0600
    user = vmail
  }
  user = root
}
ssl_cert =</etc/postfix/sslcert/server.crt
ssl_key =</etc/postfix/sslcert/server.key
userdb {
  args = /etc/dovecot/dovecot-mysql.conf
  driver = sql
}
protocol pop3 {
  pop3_uidl_format = %08Xu%08Xv
}

# Enable installed protocols
!include_try /usr/share/dovecot/protocols.d/*.protocol

# Most of the actual configuration gets included below. The filenames are
# first sorted by their ASCII value and parsed in that order. The 00-prefixes
# in filenames are intended to make it easier to understand the ordering.
!include conf.d/*.conf

# A config file can also tried to be included without giving an error if
# ried not found:
!include_try local.conf
  • 我已经在启动前删除了套接字/var/spool/postfix/private/auth_dovecot,但作为服务启动时无济于事。在 shell 中启动时,套接字 ( auth_dovecot) 会在启动时重新创建。
  • 注释掉unix_listener-part 可能会导致启动超时。错误内容为PID file /var/run/dovecot/master.pid not readable (yet?) after start
  • 对套接字使用另一个名称(/var/spool/postfix/private/auth)会导致同样的错误。
  • 我已经尝试完全重新安装 dovecot(apt purge、autoremove、autoclean、clean、install ......),但这会导致超时问题和奇怪的配置文件。
  • 在 google/stackexchange 上搜索并没有找到解决方案。

因为我可以从 shell 以 root 身份毫无问题地运行 dovecot,所以我强烈怀疑systemd会产生某种问题chroot,但我需要一些提示来进一步调查它。

先感谢您。

附言:幸运的是,我应该能够回去,debian/jessie因为我有SD 卡tar.gz的档案cubietruck

答案1

有关 似乎有一些奇怪的行为systemd

我通过编辑postfix.service文件(/etc/systemd/system/multi-user.target.wants/dovecot.service)并将默认条目设置PrivateTmp=true为来解决这个问题PrivateTmp=false

# This file is part of Dovecot
#
# If you want to pass additionally command line options to the dovecot
# binary, create the file:
#   `/etc/systemd/system/dovecot.service.d/service.conf'.
# In this file create a Service section and configure an Environment with
# the variable `OPTIONS'. For example:
#
#   [Service]
#   Environment='OPTIONS=-p'
#
# In the `Service' section you may also specify various other setting.
# If you have trouble with `Too many open files' you may set:
#LimitNOFILE=8192
#
# If you want to allow the Dovecot services to produce core dumps, use:
#LimitCORE=infinity

[Unit]
Description=Dovecot IMAP/POP3 email server
Documentation=man:dovecot(1)
Documentation=http://wiki2.dovecot.org/
After=local-fs.target network.target

[Service]
Type=forking
ExecStart=/usr/sbin/dovecot
PIDFile=/var/run/dovecot/master.pid
ExecReload=/usr/bin/doveadm reload
ExecStop=/usr/bin/doveadm stop
PrivateTmp=false
NonBlocking=yes
# Enable this if your systemd is new enough to support it:
#ProtectSystem=off

我不清楚为什么名为的配置参数PrivateTmp不仅对记录的文件夹起作用/tmp/var/tmp而且还阻止对/var/spool(或)内容的访问。/var/spool/postfix/private/auth_dovecot

相关内容