Plesk for Linux
kb: technical
ABT: Group B
Applicable to:
- Plesk for Linux
Symptoms
-
Dovecot fails to start with the following error in
/var/log/syslog file
:CONFIG_TEXT: Sep 9 04:06:09 vps1 systemd[6778]: Failed at step NAMESPACE spawning /usr/sbin/dovecot: Permission denied
-
Server is running inside LXC container
Cause
AppArmor policies on LXC host server side.
Resolution
Adjust AppArmor policies on LXC host server side: How to enable bind mount inside lxc container
OR
-
Connect to the server via SSH.
-
For the service unit set PrivateTmp to false:
-
For Debian 8 and higher:
# cat /lib/systemd/system/dovecot.service
...
[Service]
PrivateTmp=false
-
-
Reload systemd manager configuration:
# systemctl daemon-reload
-
Start Dovecot:
# systemctl start dovecot.service
Comments
2 comments
This post got me on the right path. For context, this is a debian 10 buster guest running in an LXC container on a debian buster host with dovecot 2.3.10.
Updating the service unit to avoid PrivateTmp wasn't enough. After exploring the options it seems there's no longer a way to make this work from purely within the container.
To make it work I removed all edits in the container and moved to modifying the AppArmor policies as follows:
# Do not load this file. Rather, load /etc/apparmor.d/lxc-containers, which
# will source all profiles under /etc/apparmor.d/lxc
profile lxc-container-dovecot flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/lxc/container-base>
#include <abstractions/lxc/start-container>
deny mount fstype=devpts,
mount fstype=cgroup -> /sys/fs/cgroup/**,
mount fstype=cgroup2 -> /sys/fs/cgroup/**,
mount options=(rw,bind),
mount options=(rw,rbind),
mount options=(rw,rshared),
mount options=(ro,nosuid,noexec,remount,bind,strictatime),
}
$ systemctl restart apparmor.service
# Add or edit the following line to set the apparmor profile used
lxc.apparmor.profile = lxc-container-dovecot
# stop, sleep, start
$ lxc-stop -n $container && sleep 1 && lxc-start -d -n $container
Hi @Jinn Ko,
Thank you for the provided information and for sharing your experience.
Let me note that Debian 10 is yet to be supported by Plesk. The provided advice was not tested.
Please sign in to leave a comment.