LoginSignup
1
0

More than 3 years have passed since last update.

Dovecotが「Fatal: mkdir(/usr/local/var/run/dovecot) failed: Read-only file system」と言われて起動できない

Last updated at Posted at 2020-07-26

状況

CentOS8でDovecot(2.3.10.1)をソースからコンパイルしてインストールして、起動しようとすると、「Fatal: mkdir(/usr/local/var/run/dovecot) failed: Read-only file system」と言われて起動できませんでした。

Permissionの問題かと思い、デレクトリをあらかじめ作ったり、ディレクトリのPermissionを777などにするなどいろいろ試しても、最終的に「master: Fatal: chmod() failed for /usr/local/var/run/dovecot/login: Read-only file system」が出て、にっちもさっちもいかなくなりました。

解決方法

/usr/lib/systemd/system/dovecot.service を修正します。

/usr/lib/systemd/system/dovecot.service
[Service]
...略...
ProtectSystem=false   <== full を false に変えます
...略...

systemdの設定をリロードします。

systemctl daemon-reload

ソースに対するパッチ

再コンパイルしてインストールしたら上書きされてしまうので、ソースへのパッチも置いときますね。

diff -uNr dovecot-2.3.10.1.org/dovecot.service.in dovecot-2.3.10.1/dovecot.service.in
--- dovecot-2.3.10.1.org/dovecot.service.in     2020-05-13 00:44:05.000000000 +0900
+++ dovecot-2.3.10.1/dovecot.service.in 2020-07-26 23:22:05.897623807 +0900
@@ -21,7 +21,7 @@
 ExecStop=@bindir@/doveadm stop
 PrivateTmp=true
 NonBlocking=yes
-ProtectSystem=full
+ProtectSystem=false
 ProtectHome=no
 PrivateDevices=true

おまけ

systemdの設定ファイルをインストールするには、configureするときに

./configure --with-systemdsystemunitdir=auto

のオプションを付けます。

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0