Summary: | app-containers/lxd-5.0.2-r1: requires /sys/fs/cgroup/portage to be unmounted, that is, portage's FEATURE="cgroup" must be disabled, when on a cgroup2 host | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jonas Jelten <jj> |
Component: | Current packages | Assignee: | Joonas Niilola <juippis> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | flow, gentoo, jj, virtualization |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://github.com/lxc/lxd/issues/10650#issuecomment-1180435976 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 908971 | ||
Bug Blocks: | |||
Attachments: | lxc-container-failed.log |
Description
Jonas Jelten
2023-02-14 14:39:59 UTC
Where does /sys/fs/cgroup/portage come from? Is it some custom cgroup rule you have? It could be a permission-related issue. (In reply to Joonas Niilola from comment #1) > Where does /sys/fs/cgroup/portage come from? Is it some custom cgroup rule > you have? It could be a permission-related issue. Portage mounts it on emerges if using FEATURES="cgroup", not sure if it does for anything else. Created attachment 860884 [details]
lxc-container-failed.log
I can confirm this behavior and I am pretty sure that it is related to portage's FEATURES="cgroup" being enabled.
$ mount |grep cg
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime)
$ lxc start gentoo-dnssec-test
<no-issues>
$ FEATURES="cgroup" sudo -E emerge -1 <something>
$ mount |grep cg
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup/portage type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/usr/lib/portage/python3.10/cgroup-release-agent,name=portage)
$ lxc start gentoo-riscv-crossdev-test
Error: Failed to run: /usr/bin/lxd forkstart gentoo-riscv-crossdev-test /var/lib/lxd/containers /var/log/lxd/gentoo-riscv-crossdev-test/lxc.conf: exit status 1
Try `lxc info --show-log gentoo-riscv-crossdev-test` for more info
Attached output of "lxc info --show-log gentoo-riscv-crossdev-test".
@juppis thanks for digging out that lxd issue. It seems to confirm that this is probably a portage bug: mounting a v1 cgroup /sys/fs/cgroup/portage over a v2 cgroup /sys/fs/cgroup For cross referencing, here is the link to my LXD forum post: https://discuss.linuxcontainers.org/t/failed-to-start-container-cgfsng-lxc-5-0-2-src-lxc-cgroups-cgfsng-c2139-no-such-file-or-directory-failed-to-create-cgroup-at-mnt-24/16929 The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=f8e3b11496bd6d602a690535c4a3bb32bb8e9744 commit f8e3b11496bd6d602a690535c4a3bb32bb8e9744 Author: Florian Schmaus <flow@gentoo.org> AuthorDate: 2023-06-14 15:20:13 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-07-29 11:24:45 +0000 Drop FEATURES=cgroup, i.e., v1 cgroup usage Remove portage's usage of Linux version 1 cgroups, which are itself superseded by version 2 cgroups. This basically reverts b01a1b90d8c5 ("Add FEATURES=cgroup to isolate phase processes."). Portage's usage of version 1 cgroups has caused some issues in the past. For example https://bugs.gentoo.org/894398, where LXD got confused by the existence of the version 1 cgroup created by portage. Arguably, this could be considered a bug in LXD, but with FEATURES=pid-sandbox, as better alternative to FEATURES=cgroup exists. And removing the code for FEATURES=cgroup reduces portage's code size, which is also a plus. Bug: https://bugs.gentoo.org/894398 Signed-off-by: Florian Schmaus <flow@gentoo.org> Reviewed-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1057 Signed-off-by: Sam James <sam@gentoo.org> NEWS | 5 ++ lib/_emerge/AbstractEbuildProcess.py | 88 ------------------------------------ lib/_emerge/SpawnProcess.py | 63 -------------------------- lib/portage/const.py | 1 - lib/portage/process.py | 14 ------ man/make.conf.5 | 4 -- 6 files changed, 5 insertions(+), 170 deletions(-) We really need to change the default in OpenRC as well... The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=858dfd771ac4c6c9315ac5851f4aeeb233fc21d5 commit 858dfd771ac4c6c9315ac5851f4aeeb233fc21d5 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-08-09 02:54:12 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-08-09 02:54:12 +0000 sys-apps/portage: add 3.0.50 Closes: https://bugs.gentoo.org/908971 Closes: https://bugs.gentoo.org/640658 Closes: https://bugs.gentoo.org/894398 Closes: https://bugs.gentoo.org/895908 Closes: https://bugs.gentoo.org/909067 Closes: https://bugs.gentoo.org/909148 Closes: https://bugs.gentoo.org/909853 Closes: https://bugs.gentoo.org/910035 Closes: https://bugs.gentoo.org/910376 Closes: https://bugs.gentoo.org/911594 Closes: https://bugs.gentoo.org/911574 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.50.ebuild | 229 +++++++++++++++++++++++++++++++++ 2 files changed, 230 insertions(+) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=376ab2c56e3dc7e7904ec862128bdabc07f6a00a commit 376ab2c56e3dc7e7904ec862128bdabc07f6a00a Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2024-09-29 20:18:14 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2024-09-29 22:47:07 +0000 SpawnProcess: Remove unused _CGROUP_CLEANUP_RETRY_MAX Left over from FEATURES="cgroup". Fixes: f8e3b11496bd6d602a690535c4a3bb32bb8e9744 Bug: https://bugs.gentoo.org/894398 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/_emerge/SpawnProcess.py | 4 ---- 1 file changed, 4 deletions(-) |