Hello. I’m new to LXC/LXD.
When my system drive is mounted with the noatime flag I get different kind of apparmor=“DENIED” messages in dmesg. Also timedatectl and hostnamectl in debian 10 container don’t work, there is an error:
root@buster:~# systemctl status systemd-timedated.service
systemd-timedated.service - Time & Date Service
Loaded: loaded (/lib/systemd/system/systemd-timedated.service; static; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2021-02-21 12:59:02 UTC; 41s ago
Docs: man:systemd-timedated.service(8)
man:localtime(5)
https://www.freedesktop.org/wiki/Software/systemd/timedated
Process: 102 ExecStart=/lib/systemd/systemd-timedated (code=exited, status=226/NAMESPACE)
Main PID: 102 (code=exited, status=226/NAMESPACE)
Feb 21 12:59:02 buster systemd[1]: Starting Time & Date Service...
Feb 21 12:59:02 buster systemd[102]: systemd-timedated.service: Failed to set up mount
namespacing: Permission denied
Feb 21 12:59:02 buster systemd[102]: systemd-timedated.service: Failed at step NAMESPA
CE spawning /lib/systemd/systemd-timedated: Permission denied
Feb 21 12:59:02 buster systemd[1]: systemd-timedated.service: Main process exited, cod
e=exited, status=226/NAMESPACE
Feb 21 12:59:02 buster systemd[1]: systemd-timedated.service: Failed with result 'exit
-code'.
Feb 21 12:59:02 buster systemd[1]: Failed to start Time & Date Service.
At the same time in the dmesg there is:
type=1400 audit(1613910952.362:46): apparmor="DENIED" operation="mount" info="failed flags
match" error=-13 profile="lxd-buster_</var/snap/lxd/common/lxd>" name="/run/systemd/unit-
root/" pid=3692 comm="(imedated)" flags="ro, remount, noatime, bind"
Any advice how to solve this?
Tried with LXD 4.11 and 4.0.5, but it is the same with both. The only thing that seems to fix the problem is not to use the noatime flag in fstab for the system drive.
My host OS is Debian 10.8, it has apparmor 2.13.2. Containers are all unprivileged.
Thanks.