lxc: set --with-runtime-path to the /var/run path
authorRafał Miłecki <rafal@milecki.pl>
Sat, 8 Apr 2023 16:18:55 +0000 (18:18 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Fri, 19 May 2023 15:48:03 +0000 (17:48 +0200)
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 --with-runtime-path allows using pure "lxc" in
OpenWrt (without the "lxc-auto").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 90fef036fe465262d5915489d45f430b313f22ab)

utils/lxc/Makefile
utils/lxc/files/lxc-auto.init

index 6f4fd0c960b55f62d57b1c8764ea276d8901fb82..89a760e98c5f337bead42e388c546e2159dfc07f 100644 (file)
@@ -144,7 +144,8 @@ CONFIGURE_ARGS += \
        --disable-selinux \
        --$(if $(CONFIG_LXC_SECCOMP),en,dis)able-seccomp \
        --enable-capabilities \
-       --disable-examples
+       --disable-examples \
+       --with-runtime-path=/var/run
 
 ifdef CONFIG_USE_MIPS16
   TARGET_CFLAGS += -minterlink-mips16
index 4983c5919663febf59ff065ee7d2dbb195ef8a85..14fe2c509b87bb2918f347208c01f1289457d0cb 100755 (executable)
@@ -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
 }