Skip to content

Commit b7dd2d0

Browse files
committed
update how to disable cgroupsv2 in azl3
1 parent 631aae7 commit b7dd2d0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

articles/operator-nexus/howto-disable-cgroupsv2.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,17 @@ spec:
118118
CGROUP_VERSION=`stat -fc %T /sys/fs/cgroup/`
119119
if [ "$CGROUP_VERSION" == "cgroup2fs" ]; then
120120
echo "Using v2, reverting..."
121-
sed -i 's/systemd.unified_cgroup_hierarchy=1 cgroup_no_v1=all/systemd.unified_cgroup_hierarchy=0/' /boot/grub2/grub.cfg
121+
if uname -r | grep -q "cm2"; then
122+
echo "Detected Azure Linux OS version older than v3"
123+
sed -i 's/systemd.unified_cgroup_hierarchy=1 cgroup_no_v1=all/systemd.unified_cgroup_hierarchy=0/' /boot/grub2/grub.cfg
124+
else
125+
sed -i 's/systemd.unified_cgroup_hierarchy=1 cgroup_no_v1=all/systemd.unified_cgroup_hierarchy=0/' /etc/default/grub
126+
grub2-mkconfig -o /boot/grub2/grub.cfg
127+
if ! grep -q systemd.unified_cgroup_hierarchy=0 /boot/grub2/grub.cfg; then
128+
echo "failed to update grub2 config"
129+
exit 1
130+
fi
131+
fi
122132
reboot
123133
fi
124134

0 commit comments

Comments
 (0)