Skip to content

Commit

Permalink
Rename function to match its (changed) behavior
Browse files Browse the repository at this point in the history
Suggested-by: @eldering
  • Loading branch information
ankon authored and eldering committed Sep 21, 2023
1 parent 2c23c59 commit 251732b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions judge/create_cgroups.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
JUDGEHOSTUSER=@DOMJUDGE_USER@
CGROUPBASE=@judgehost_cgroupdir@

print_cgroup_instruction () {
cgroup_error_and_usage () {
echo "$1" >&2
echo "To fix this, please make the following changes:
1. In /etc/default/grub, add 'cgroup_enable=memory swapaccount=1' to GRUB_CMDLINE_LINUX_DEFAULT.
Expand All @@ -24,14 +24,14 @@ for i in cpuset memory; do
mkdir -p $CGROUPBASE/$i
if [ ! -d $CGROUPBASE/$i/ ]; then
if ! mount -t cgroup -o$i $i $CGROUPBASE/$i/; then
print_cgroup_instruction "Error: Can not mount $i cgroup. Probably cgroup support is missing from running kernel. Unable to continue."
cgroup_error_and_usage "Error: Can not mount $i cgroup. Probably cgroup support is missing from running kernel. Unable to continue."
fi
fi
mkdir -p $CGROUPBASE/$i/domjudge
done

if [ ! -f $CGROUPBASE/memory/memory.limit_in_bytes ] || [ ! -f $CGROUPBASE/memory/memory.memsw.limit_in_bytes ]; then
print_cgroup_instruction "Error: cgroup support missing memory features in running kernel. Unable to continue."
cgroup_error_and_usage "Error: cgroup support missing memory features in running kernel. Unable to continue."
fi

chown -R $JUDGEHOSTUSER $CGROUPBASE/*/domjudge
Expand Down

0 comments on commit 251732b

Please sign in to comment.