Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE: patches runc for al2023 kind image runing on al2 host #2821

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 038a28ac09a546c838ddefc86192d4236e8bedc3 Mon Sep 17 00:00:00 2001
From: Jackson West <jaxesn@gmail.com>
Date: Tue, 16 Jan 2024 21:33:24 +0000
Subject: [PATCH] Revert "libctr/cgroups: don't take init's cgroup into
account"

This reverts commit 10cfd816317789da4393d70ead92ec7c203e1926.
---
libcontainer/cgroups/systemd/v1.go | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libcontainer/cgroups/systemd/v1.go b/libcontainer/cgroups/systemd/v1.go
index a574552d..57384780 100644
--- a/libcontainer/cgroups/systemd/v1.go
+++ b/libcontainer/cgroups/systemd/v1.go
@@ -274,7 +274,14 @@ func getSubsystemPath(slice, unit, subsystem string) (string, error) {
return "", err
}

- return filepath.Join(mountpoint, slice, unit), nil
+ initPath, err := cgroups.GetInitCgroup(subsystem)
+ if err != nil {
+ return "", err
+ }
+ // if pid 1 is systemd 226 or later, it will be in init.scope, not the root
+ initPath = strings.TrimSuffix(filepath.Clean(initPath), "init.scope")
+
+ return filepath.Join(mountpoint, initPath, slice, unit), nil
}

func (m *legacyManager) Freeze(state configs.FreezerState) error {
--
2.34.1