Skip to content

Commit

Permalink
init.d/cgroups.in: fix inconsistency between mount_cgroups and mount_…
Browse files Browse the repository at this point in the history
…cgroups

965de92 changed the default cgroup mode which
exposes an issue in init.d/cgroups.in.

While mount_cgroups defaults to 'unified' if rc_cgroup_mode is unset, cgroup2_controllers
has no default and therefore has a mismatch with the logic in mount_cgroups. The
two should be consistent so the flow makes sense, as mount_cgroups expects a certain
path to be taken in cgroup2_controllers.

Make cgroup2_controllers default to 'unified' if rc_cgroup_mode is unset, just
like mount_cgroups.

Bug: https://bugs.gentoo.org/916964
Thanks-to: [email protected]
  • Loading branch information
thesamesam committed Nov 12, 2023
1 parent 1433552 commit ecca089
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion init.d/cgroups.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ cgroup2_controllers()
[ ! -e "${cgroup_path}/cgroup.subtree_control" ]&& return 0
read -r active < "${cgroup_path}/cgroup.controllers"
for x in ${active}; do
case "$rc_cgroup_mode" in
case "${rc_cgroup_mode:-unified}" in
unified)
echo "+${x}" > "${cgroup_path}/cgroup.subtree_control"
;;
Expand Down

0 comments on commit ecca089

Please sign in to comment.