|
9 | 9 | JUDGEHOSTUSER=@DOMJUDGE_USER@
|
10 | 10 | CGROUPBASE=@judgehost_cgroupdir@
|
11 | 11 |
|
| 12 | +print_cgroup_instruction () { |
| 13 | + echo "" |
| 14 | + echo "To fix this, please make the following changes: |
| 15 | + 1. In /etc/default/grub, add 'cgroup_enable=memory swapaccount=1' to GRUB_CMDLINE_LINUX_DEFAULT. |
| 16 | + On modern distros (e.g. Debian bullseye and Ubuntu Jammy Jellyfish) which have cgroup v2 enabled by default, |
| 17 | + you need to add 'systemd.unified_cgroup_hierarchy=0' as well. |
| 18 | + 2. Run update-grub |
| 19 | + 3. Reboot" >&2 |
| 20 | + exit 1 |
| 21 | +} |
| 22 | + |
12 | 23 | for i in cpuset memory; do
|
13 | 24 | mkdir -p $CGROUPBASE/$i
|
14 | 25 | if [ ! -d $CGROUPBASE/$i/ ]; then
|
15 | 26 | if ! mount -t cgroup -o$i $i $CGROUPBASE/$i/; then
|
16 |
| - echo "Error: Can not mount $i cgroup. Probably cgroup support is missing from running kernel. Unable to continue. |
17 |
| -
|
18 |
| - To fix this, please make the following changes: |
19 |
| - 1. In /etc/default/grub, add 'cgroup_enable=memory swapaccount=1' to GRUB_CMDLINE_LINUX_DEFAULT |
20 |
| - On modern distros (e.g. Debian bullseye and Ubuntu Jammy Jellyfish) which have cgroup v2 enabled by default, |
21 |
| - you need to add 'systemd.unified_cgroup_hierarchy=0' as well. |
22 |
| - 2. Run update-grub |
23 |
| - 3. Reboot" >&2 |
24 |
| - exit 1 |
| 27 | + echo "Error: Can not mount $i cgroup. Probably cgroup support is missing from running kernel. Unable to continue." |
| 28 | + print_cgroup_instruction |
25 | 29 | fi
|
26 | 30 | fi
|
27 | 31 | mkdir -p $CGROUPBASE/$i/domjudge
|
28 | 32 | done
|
29 | 33 |
|
30 | 34 | if [ ! -f $CGROUPBASE/memory/memory.limit_in_bytes ] || [ ! -f $CGROUPBASE/memory/memory.memsw.limit_in_bytes ]; then
|
31 |
| - echo "Error: cgroup support missing memory features in running kernel. Unable to continue. |
32 |
| -
|
33 |
| - To fix this, please make the following changes: |
34 |
| - 1. In /etc/default/grub, add 'cgroup_enable=memory swapaccount=1' to GRUB_CMDLINE_LINUX_DEFAULT. |
35 |
| - On modern distros (e.g. Debian bullseye and Ubuntu Jammy Jellyfish) which have cgroup v2 enabled by default, |
36 |
| - you need to add 'systemd.unified_cgroup_hierarchy=0' as well. |
37 |
| - 2. Run update-grub |
38 |
| - 3. Reboot" >&2 |
39 |
| - exit 1 |
| 35 | + echo "Error: cgroup support missing memory features in running kernel. Unable to continue." |
| 36 | + print_cgroup_instruction |
40 | 37 | fi
|
41 | 38 |
|
42 | 39 | chown -R $JUDGEHOSTUSER $CGROUPBASE/*/domjudge
|
|
0 commit comments