Description
I'm trying to use LXCFS together with plain systemd-nspawn under SLES 15.5.
LXCFS starts and works without issues.
When trying to "bind-mount" LXCFS directories into a starting/new systemd-nspawn container, "systemd-nspawn' cannot find/access the LXCFS directories:
# systemd-nspawn -b --property=MemoryMax=256M -D /srv/container/suse15/ --bind /var/lib/lxcfs/proc/uptime:/proc/uptime
Spawning container suse15 on /srv/container/suse15.
Press ^] three times within 1s to kill container. Failed to stat /var/lib/lxcfs/proc/uptime: No such file or directory
Child died too early.
# ls -la /var/lib/lxcfs/proc/uptime
-r--r--r-- 1 root root 14 Mar 31 11:37 /var/lib/lxcfs/proc/uptime
Starting the container without the "bind-mounts" and creating the "bind-mounts" (one-by-one) after startup with "machinectl bind" does work ("suse15" is the name of the running NSpawn-container):
# machinectl bind suse15 /var/lib/lxcfs/proc/uptime /proc/uptime
While using "machinectl bind" is a workaround, I would like to understand why the bind-mount does fail during "systemd-nspawn" startup.
This issue might have it's root cause inside systemd, but because it is a LXCFS specific issue, someone here might be able to point me into the right direction.