Skip to content

Commit

Permalink
Merge pull request #1288 from YJDoc2/fix_cgroup_setup
Browse files Browse the repository at this point in the history
Fix how cgroup manager is created based on cgroups path
  • Loading branch information
utam0k authored Oct 21, 2022
2 parents bcdfd59 + 2d48e16 commit d3f3c5f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/libcgroups/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ pub fn create_cgroup_manager<P: Into<PathBuf>>(
match cgroup_setup {
CgroupSetup::Legacy | CgroupSetup::Hybrid => create_v1_cgroup_manager(cgroup_path),
CgroupSetup::Unified => {
if systemd_cgroup {
return create_systemd_cgroup_manager(cgroup_path, container_name);
// ref https://github.com/opencontainers/runtime-spec/blob/main/config-linux.md#cgroups-path
if cgroup_path.is_absolute() || !systemd_cgroup {
return create_v2_cgroup_manager(cgroup_path);
}

create_v2_cgroup_manager(cgroup_path)
create_systemd_cgroup_manager(cgroup_path, container_name)
}
}
}
Expand Down

0 comments on commit d3f3c5f

Please sign in to comment.