Open loheagn opened 6 months ago
If this is a bug, I'd like to submit a PR to fix it :)
Thanks, I think it's not a bug:
func (x *CriuOpts) GetManageCgroupsMode() CriuCgMode {
if x != nil && x.ManageCgroupsMode != nil {
return *x.ManageCgroupsMode
}
return CriuCgMode_IGNORE
}
But it seems that it doesn't fit to the doc you provided: Default is SOFT
Thanks, I think it's not a bug:
func (x *CriuOpts) GetManageCgroupsMode() CriuCgMode { if x != nil && x.ManageCgroupsMode != nil { return *x.ManageCgroupsMode } return CriuCgMode_IGNORE }
But it seems that it doesn't fit to the doc you provided:
Default is SOFT
@lifubang Thanks for the reply.
However, I don't think the code you provided is helpful in answering this question. This piece of code is not used by the code being run, and I am not sure if it will be used by CRIU to determine the value of --manage-cgroups
. (In fact, I think this code looks like it was automatically generated using a proto tool, and in itself does not have any significance.) In fact, according to CRIU's documentation, the default value for --manage-cgroups
is not ignore
, but soft
.
In fact, according to CRIU's documentation, the default value for --manage-cgroups is not ignore, but soft.
IIUC, If you don't set --manage-cgroups
, it should be able to pass ignore as a --manage-cgroup-mode
.
Please note that --manage-cgroups-mode ignore
(https://github.com/opencontainers/runc/pull/3546) only appeared in runc 1.2.
It looks like you're using runc 1.1.10 which does not have it.
Please give https://github.com/opencontainers/runc/releases/tag/v1.2.0-rc.1 a try and see if it helps.
Hello, for me it helped.
Description
I am attempting to use runc to checkpoint and restore containers (by calling CRIU), and I do not want CRIU to dump and restore cgroups. I found in the documentation for restore that this can be achieved by setting the![img_v3_027d_039db343-0caf-4081-965f-edc5f38b82eg](https://github.com/opencontainers/runc/assets/33423736/de7b154e-4b5a-49f6-997e-87920364dea3)
--manage-cgroups-mode
parameter toignore
during the checkpoint and restore process.However, I discovered through the code that if I set
--manage-cgroups-mode
toignore
, this parameter will not ultimately take effect in the final concatenation of the call to CRIU's rpc options, as the value ofignore
is 0.https://github.com/opencontainers/runc/blob/313ec8bcabe62b31fdab24c11fbf2d3c0a65e5fa/libcontainer/criu_linux.go#L389-L393
Steps to reproduce the issue
1. 2. 3.
Describe the results you received and expected
If a user sets
--manage-cgroups-mode
toignore
while using the checkpoint or restore commands, runc should translate this value into the corresponding enumeration value given in go-criu (which is0
) and append it torpcOpts
. However, the current logic fails to retain the user's setting ofignore
, and does not pass the corresponding--manage-cgroups
option to CRIU, resulting in CRIU usingsoft
instead ofignore
as the default value.What version of runc are you using?
runc version 1.1.10 commit: v1.1.10-0-g18a0cb0f-dirty spec: 1.0.2-dev go: go1.21.6 libseccomp: 2.5.4
Host OS information
PRETTY_NAME="Ubuntu 23.10" NAME="Ubuntu" VERSION_ID="23.10" VERSION="23.10 (Mantic Minotaur)" VERSION_CODENAME=mantic ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=mantic LOGO=ubuntu-logo
Host kernel information
Linux lima-ccr-dev 6.5.0-14-generic #14-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 14 15:13:47 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux