From 08780406d0861771b6a67b0bb47470f4ba24a083 Mon Sep 17 00:00:00 2001 From: Zolfa Date: Wed, 5 Oct 2022 19:12:28 +0000 Subject: [PATCH] lxc-auto: remount /proc and /sys with relatime Otherwise containers fail to start, if set to noatime. --- utils/lxc/files/lxc-auto.init | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/lxc/files/lxc-auto.init b/utils/lxc/files/lxc-auto.init index 7655a374f..6fdb1035c 100755 --- a/utils/lxc/files/lxc-auto.init +++ b/utils/lxc/files/lxc-auto.init @@ -64,6 +64,11 @@ stop() { #Export systemd cgroups boot() { + # change noatime to relative for proc and aysfs + # otherise lxc (unprivileged at least) fails to start + mount -t proc -o remount,rw,nosuid,nodev,noexec,relatime proc /proc + mount -t sysfs -o remount,rw,nosuid,nodev,noexec,relatime sysfs /sys + if [ ! -d /sys/fs/cgroup/systemd ]; then mkdir -p /sys/fs/cgroup/systemd mount -t cgroup -o rw,nosuid,nodev,noexec,relatime,none,name=systemd cgroup /sys/fs/cgroup/systemd