fix cpu controller not set in cgroup v2

This commit is contained in:
bingshen.wbs
2023-01-30 19:28:07 +08:00
parent a3923351af
commit 50ee67b657

View File

@@ -1,10 +1,10 @@
#!/bin/bash
echo $CGROUP_MODE
if [[ ! -z $CGROUP_MODE ]] && [[ $CGROUP_MODE =~ .*[v,V]2.* ]]; then
echo "set cgroup mode to $CGROUP_MODE"
if ! grep -q 'systemd.unified_cgroup_hierarchy=1' /etc/default/grub; then
grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=1"
grubby --update-kernel=ALL --args="cgroup_no_v1=all"
fi
fi