Browse Source

lxc-unprivileged: fix mount options issue

Fix an issue that cause unprivileged containers to not boot if /proc and
/sys are mounted with the `noatime` option.

At boot time /proc and /sys are remounted with the `relatime` option
using a dedicated init.d script.
lilik-openwrt-22.03
Zolfa 2 years ago
parent
commit
9ac5a07007
2 changed files with 15 additions and 1 deletions
  1. +2
    -1
      utils/lxc/Makefile
  2. +13
    -0
      utils/lxc/files/lxc-unprivileged.init

+ 2
- 1
utils/lxc/Makefile View File

@ -97,8 +97,9 @@ define Package/lxc-unprivileged/description
endef
define Package/lxc-unprivileged/install
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/etc/uci-defaults $(1)/etc/init.d
$(INSTALL_DATA) ./files/lxc-unprivileged.defaults $(1)/etc/uci-defaults/lxc-unprivileged
$(INSTALL_BIN) ./files/lxc-unprivileged.init $(1)/etc/init.d
endef
define Package/lxc/config


+ 13
- 0
utils/lxc/files/lxc-unprivileged.init View File

@ -0,0 +1,13 @@
#!/bin/sh /etc/rc.common
. /lib/functions.sh
START=98
# Remount /proc and /sys on host with relatime option,
# required for unprivileged containers to boot correctly.
boot() {
mount -t proc -o remount,rw,nosuid,nodev,noexec,relatime proc /proc
mount -t sysfs -o remount,rw,nosuid,nodev,noexec,relatime sysfs /sys
}

Loading…
Cancel
Save