.png)
Buster의 lxc에서 dovecot을 실행할 수 없습니다. PrivateTmp를 꺼두었지만 충분하지 않습니다. 여전히:
[ 4850.883141] audit: type=1400 audit(1563803461.322:34): apparmor="DENIED" operation="mount" info="failed flags match" error=-13 profile="lxc-container-default-cgns" name="/" pid=23810 comm="(dovecot)" flags="rw, rslave"
답변1
제한되지 않은 AppArmor 값을 사용해 보셨나요?
lxc.apparmor.profile: unconfined
/etc/pve/lxc/CTID.conf에 설정하십시오.
답변2
불행히도 PrivateTmp를 피하기 위해 서비스 단위를 업데이트하는 것은 호스트의 AppArmor를 통해 필요한 권한을 부여하지 않으면 LXC에서 작동하지 않습니다.
옵션을 탐색해 본 결과 컨테이너 내에서만 이 작업을 수행할 수 있는 방법은 더 이상 없는 것 같습니다.
작동하도록 하기 위해 컨테이너의 모든 편집 내용을 제거하고(따라서 PrivateTmp 구성 제거) 다음과 같이 AppArmor 정책을 수정하는 작업으로 이동했습니다.
호스트에서 새 AppArmor 정책을 생성
/etc/apparmor.d/lxc/lxc-dovecot
하고 다음으로 채웁니다.# 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), }
AppArmor를 다시 로드하세요.
$ systemctl restart apparmor.service
일반적으로 다음 행을 LXC 컨테이너 구성에 추가하여 새 프로필을 사용하도록 컨테이너를 설정합니다
/var/lib/lxc/$container/config
.# Add or edit the following line to set the apparmor profile used lxc.apparmor.profile = lxc-container-dovecot
컨테이너를 다시 시작합니다.
$ lxc-stop -n $container && sleep 1 && lxc-start -d -n $container