From 20d9cf4bc2a8f5784eb7d3df131c3fe2806244e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sat, 8 Apr 2023 18:18:55 +0200 Subject: [PATCH] lxc: set RUNTIME_PATH define to the /var/run path MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The default runtime directory used by LXC is /run which doesn't exist in OpenWrt. It causes errors like: Failed to create lock for foo lxc-create: foo: tools/lxc_create.c: main: 260 Failed to create lxc container There has been workaround for that in the lxc-auto.init but it requires installing "lxc-auto" package. Replacing that "ln -s" workaround with Makefile specifying RUNTIME_PATH define allows using pure "lxc" in OpenWrt (without the "lxc-auto"). Signed-off-by: Rafał Miłecki (cherry picked from commit 90fef036fe465262d5915489d45f430b313f22ab) --- utils/lxc/Makefile | 3 ++- utils/lxc/files/lxc-auto.init | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/utils/lxc/Makefile b/utils/lxc/Makefile index a8f499448a..4a79f2fec9 100644 --- a/utils/lxc/Makefile +++ b/utils/lxc/Makefile @@ -33,7 +33,8 @@ MESON_ARGS += \ -Dselinux=false \ -Dseccomp=$(if $(CONFIG_LXC_SECCOMP),true,false) \ -Dexamples=false \ - -Db_pie=true + -Db_pie=true \ + -Druntime-path=/var/run LXC_APPLETS_BIN += \ attach autostart cgroup copy config console create destroy device \ diff --git a/utils/lxc/files/lxc-auto.init b/utils/lxc/files/lxc-auto.init index 4983c59196..14fe2c509b 100755 --- a/utils/lxc/files/lxc-auto.init +++ b/utils/lxc/files/lxc-auto.init @@ -69,9 +69,5 @@ boot() { mount -t cgroup -o rw,nosuid,nodev,noexec,relatime,none,name=systemd cgroup /sys/fs/cgroup/systemd fi - if [ ! -d /run ]; then - ln -s /var/run /run - fi - start } -- 2.30.2