File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,17 @@ spec:
118
118
CGROUP_VERSION=`stat -fc %T /sys/fs/cgroup/`
119
119
if [ "$CGROUP_VERSION" == "cgroup2fs" ]; then
120
120
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
122
132
reboot
123
133
fi
124
134
You can’t perform that action at this time.
0 commit comments