LXC parse.c cannot process (sendfile) configuration files on ZFS dataset
Yesterday I upgraded from 3.12 to 3.13.0_rc2 and ran into two problems. I could solve the 1st (see #12176 (closed)), and could also develop a partial workaround for the 2nd.
I have 2 LXC containers on my Alpine host. These worked fine under 3.12, but did not start after upgrade. Error messages at attempting to boot the container (hostnames have been masked):
HOST [~]# lxc-start -n CONTAINER lxc-start: CONTAINER: parse.c: lxc_file_for_each_line_mmap: 86 Invalid argument - Failed to sendfile "/usr/share/lxc/config/common.conf.d//00-lxcfs.conf" lxc-start: CONTAINER: parse.c: lxc_file_for_each_line_mmap: 120 Failed to parse config file "/srv/lxc/CONTAINER/config" at line "lxc.include = /usr/share/lxc/config/common.conf.d/" Failed to load config for container lxc-start: CONTAINER: tools/lxc_start.c: main: 242 Failed to create lxc_container HOST [~]# uname -r 5.10.4-0-lts
- /dev/sda1: /boot, ext4
- /dev/sda2: ZFS root, the containers are also here, but on a different dataset
The workaround is:
cp /srv/lxc/CONTAINER/config /boot/CONTAINER.config
- remove all the
lxc.includelines in the copy
- instead concatenate the included configuration files to the copy
- make a backup about the original configuration, remove it, then
ln -s /boot/CONTAINER.config /srv/lxc/CONTAINER/config
And presto, it works! I could test it only with one of the containers yet (which is also Alpine).
So I guess the new kernel, ZFS and LXC do not like each other.