Skip to content

Commit

Permalink
core/openrc: set the default rc_cgroup_mode back to hybrid
Browse files Browse the repository at this point in the history
openrc-0.51-r0 switched the default rc_cgroup_mode from hybrid
to unified. This revealed an issue with `docker top` which
is critical for our infrastructure:

opencontainers/runc#4097

While the issue is being investigated, we are reverting
the mode back to hybrid to make `docker top` work with
the default openrc configuration.
  • Loading branch information
kholmanskikh committed Oct 26, 2023
1 parent 6d98d5c commit c5e751f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
46 changes: 46 additions & 0 deletions core/openrc/0104-Set-default-rc_cgroup_mode-back-to-hybrid.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From b3b8d1f8a2f37209879449ff7604eb628bd04087 Mon Sep 17 00:00:00 2001
From: Stanislav Kholmanskikh <stanislav.kholmanskikh@bell-sw.com>
Date: Thu, 26 Oct 2023 15:59:46 +0300
Subject: [PATCH] Set default rc_cgroup_mode back to hybrid

When it's "unified", docker top fails. See:

https://github.com/opencontainers/runc/issues/4097

It looks like an issue in runc, but fixing it
may take some time. Meanwhile we should make docker
work with the default openrc configuration.
---
etc/rc.conf | 2 +-
init.d/cgroups.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/etc/rc.conf b/etc/rc.conf
index 6f226cc..580f310 100644
--- a/etc/rc.conf
+++ b/etc/rc.conf
@@ -203,7 +203,7 @@ rc_tty_number=12
# cgroups version 1 on /sys/fs/cgroup.
# "legacy" mounts cgroups version 1 on /sys/fs/cgroup
# "unified" mounts cgroups version 2 on /sys/fs/cgroup
-#rc_cgroup_mode="unified"
+#rc_cgroup_mode="hybrid"

# This is a list of controllers which should be enabled for cgroups version 2
# when hybrid mode is being used.
diff --git a/init.d/cgroups.in b/init.d/cgroups.in
index faf53d8..4fa6b13 100644
--- a/init.d/cgroups.in
+++ b/init.d/cgroups.in
@@ -128,7 +128,7 @@ cgroups_unified()

mount_cgroups()
{
- case "${rc_cgroup_mode:-unified}" in
+ case "${rc_cgroup_mode:-hybrid}" in
hybrid) cgroups_hybrid ;;
legacy) cgroups_legacy ;;
unified) cgroups_unified ;;
--
2.41.0

4 changes: 3 additions & 1 deletion core/openrc/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pkgname=openrc
pkgver=0.51
_ver=${pkgver/_git*/}
pkgrel=0
pkgrel=1
pkgdesc="OpenRC dependency-based init system"
url="https://github.com/OpenRC/openrc"
arch="all"
Expand Down Expand Up @@ -53,6 +53,7 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/OpenRC/openrc/archive/$pkgve
0101-init.d-agetty-depend-on-hostname-to-show-in-prompt.patch
0102-openrc-add-rc_quiet_openrc-for-openrc-binary.patch
0103-mountinfo-only-explicit-quiet.patch
0104-Set-default-rc_cgroup_mode-back-to-hybrid.patch
"
options="!check" # not updated to meson build system, require makefile build
replaces="$VENDOR_DISTRO-baselayout" # due to move of mkmntdirs
Expand Down Expand Up @@ -203,4 +204,5 @@ af17947aa3954e317dc06580da829200e0b0f2ddc37ce842c3fc7fc0d8ca2f40220e4f4665f61b4b
aaf51536d18188951fe20da1b4459ae8b976f7bb6a1927d5cace1c305037b40481c496d71e6677bad2bb2dbfdeefaa5d54b6f5e326ddd5b471d3ddfff440621c 0101-init.d-agetty-depend-on-hostname-to-show-in-prompt.patch
2f55eb788c49a87031e2311dd549d720650b48b00bb562e1797e18b1a85f523525b50639d0601040a7f23574988d07b16cd603669ce1d90ee03d75b4fb37b608 0102-openrc-add-rc_quiet_openrc-for-openrc-binary.patch
bfa580eeac40aba91c98e0e754c3e198068f12d2570c02dfe5a74233cab141514a7a9e7e6d4dea613846a1a8f96ed0ab349194497f63b80ea09cc43a2ba7d79c 0103-mountinfo-only-explicit-quiet.patch
ebe2fd240449ba45b81d6534a78a411116fe01b429e5337c7b1b0ecf82dc448cfa6487322f44f04754c54c0363abdbca85ebef6f98fe7244af56d210ffaee323 0104-Set-default-rc_cgroup_mode-back-to-hybrid.patch
"

0 comments on commit c5e751f

Please sign in to comment.