Following Simon's suggestion, I decided to try setting up lxc to use autopkgtest-lxc, mimicking the ci.debian.org setup. I haven't managed
to do so yet, and have run into lots of problems. I'd really
appreciate some advice on what to try, and them we can record advice
somewhere on the Debian wiki.
Following the advice in autopkgtest-build-lxc(1), that user containers
will not work with many or even most autopkgtests, I ran it as route.
Step 1: Install the lxc and autopkgtest packages
That went smoothly. (lxc version 1:4.0.11-1, autopkgtest version 5.21)
Step 2: Run the command "autopkgtest-build-lxc debian sid"
I got various warning messages, and this essentially failed...
lxc-create: autopkgtest-sid: storage/btrfs.c: btrfs_create: 938 Inappropriate ioctl for device - Failed to create btrfs subvolume "/var/lib/lxc/autopkgtest-sid/rootfs"
lxc-create: autopkgtest-sid: storage/zfs.c: zfs_create: 735 Failed to create zfs dataset "zfs:lxc/autopkgtest-sid": lxc-create: autopkgtest-sid: utils.c: run_command_internal: 1588
lxc-create: autopkgtest-sid: storage/lvm.c: do_lvm_create: 165 Failed to create logical volume "autopkgtest-sid": Volume group "lxc" not found
Cannot process volume group lxc
lxc-create: autopkgtest-sid: storage/lvm.c: lvm_create: 623 Error creating new logical volume "lvm:/dev/lxc/autopkgtest-sid" of size "1073741824 bytes"
debootstrap is /usr/sbin/debootstrap
Checking cache download in /var/cache/lxc/debian/rootfs-sid-amd64 ... Downloading debian minimal ...
I: Target architecture can be executed
I: Retrieving InRelease
[downloading and installing base system]
I: Base system installed successfully.
Download complete.
Copying rootfs to /var/lib/lxc/autopkgtest-sid/rootfs...ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Generating locales (this might take a while)...
ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
en_GB.UTF-8ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
[... lots more libeatmydata.so warnings, interspersed with other
information messages ...]
ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
lxc-start: autopkgtest-sid: lxccontainer.c: wait_on_daemonized_start: 867 Received container state "ABORTING" instead of "RUNNING"
lxc-start: autopkgtest-sid: tools/lxc_start.c: main: 306 The container failed to start
lxc-start: autopkgtest-sid: tools/lxc_start.c: main: 309 To get more details, run the container in foreground mode
lxc-start: autopkgtest-sid: tools/lxc_start.c: main: 311 Additional information can be obtained by setting the --logfile and --logpriority options
Something weird is going on here, but autopkgtest-build-lxc doesn't
seem to allow a --logfile option.
I attempted to start it manually, using the command
lxc-start -n autopkgtest-sid --logfile /tmp/lxc.log --logpriority INFO
and got the following errors in the log file:
lxc-start autopkgtest-sid 20220429124743.756 WARN cgfsng - cgroups/cgfsng.c:get_hierarchy:142 - There is no useable devices controller
lxc-start autopkgtest-sid 20220429124743.756 ERROR cgfsng - cgroups/cgfsng.c:cg_legacy_set_data:2675 - No such file or directory - Failed to setup limits for the "devices" controller. The controller seems to be unused by "cgfsng" cgroup driver or not
enabled on the cgroup hierarchy
lxc-start autopkgtest-sid 20220429124743.756 ERROR cgfsng - cgroups/cgfsng.c:cgfsng_setup_limits_legacy:2742 - No such file or directory - Failed to set "devices.deny" to "a"
lxc-start autopkgtest-sid 20220429124743.756 ERROR start - start.c:lxc_spawn:1890 - Failed to setup legacy device cgroup controller limits
lxc-start autopkgtest-sid 20220429124743.756 ERROR lxccontainer - lxccontainer.c:wait_on_daemonized_start:867 - Received container state "ABORTING" instead of "RUNNING"
[...]
I found something like this reported at this GitHub issue against lxc:
https://github.com/lxc/lxc/issues/2268
so I followed the advice there and ran the commands:
mount -o remount,rw /sys/fs/cgroup
mkdir /sys/fs/cgroup/devices
mount -t cgroup devices -o devices /sys/fs/cgroup/devices
mount -o remount,ro /sys/fs/cgroup
But that seems to be really bad, as now systemd-logind.service seems
to have broken and cannot be restarted, so I don't recommend doing
that!
I've restarted my system and started again. The above solution is
very bad at least partly because /sys/fs/cgroup is type cgroup2. But
I still can't start the LXC container, which makes running autopkgtest impossible.
Is this a bug in lxc or in autopkgtest-build-lxc or somewhere else?
Any suggestions would be much appreciated!
Julian
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)