Skip to content

Commit

Permalink
Remove configure option for cgroup location
Browse files Browse the repository at this point in the history
runguard.c has the default location hardcoded and no one complained. It
would be easy to use the autoconf option (and would have taken less code
changes).
  • Loading branch information
vmcj authored and nickygerritsen committed Jun 3, 2024
1 parent 8f4539b commit e6c58ec
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 15 deletions.
10 changes: 2 additions & 8 deletions .github/jobs/configure-checks/all.bats
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ compile_assertions_finished () {
assert_line " - tmp..............: /opt/domjudge/judgehost/tmp"
assert_line " - judge............: /opt/domjudge/judgehost/judgings"
assert_line " - chroot...........: /chroot/domjudge"
assert_line " - cgroup...........: /sys/fs/cgroup"
}

@test "Prefix configured" {
Expand Down Expand Up @@ -309,12 +308,11 @@ compile_assertions_finished () {
assert_line " - tmp..............: /tmp"
assert_line " - judge............: /usr/local/var/lib/domjudge/judgings"
assert_line " - chroot...........: /chroot/domjudge"
assert_line " - cgroup...........: /sys/fs/cgroup"
}

@test "Alternative dirs together with FHS" {
setup
run run_configure --enable-fhs --with-domserver_webappdir=/run/webapp --with-domserver_tmpdir=/tmp/domserver --with-judgehost_tmpdir=/srv/tmp --with-judgehost_judgedir=/srv/judgings --with-judgehost_chrootdir=/srv/chroot/domjudge --with-judgehost_cgroupdir=/sys/fs/altcgroup
run run_configure --enable-fhs --with-domserver_webappdir=/run/webapp --with-domserver_tmpdir=/tmp/domserver --with-judgehost_tmpdir=/srv/tmp --with-judgehost_judgedir=/srv/judgings --with-judgehost_chrootdir=/srv/chroot/domjudge
assert_line " * prefix..............: /usr/local"
assert_line " * documentation.......: /usr/local/share/doc/domjudge"
assert_line " * domserver...........: "
Expand Down Expand Up @@ -343,13 +341,11 @@ compile_assertions_finished () {
assert_line " - judge............: /srv/judgings"
refute_line " - chroot...........: /chroot/domjudge"
assert_line " - chroot...........: /srv/chroot/domjudge"
refute_line " - cgroup...........: /sys/fs/cgroup"
assert_line " - cgroup...........: /sys/fs/altcgroup"
}

@test "Alternative dirs together with defaults" {
setup
run run_configure "--with-judgehost_tmpdir=/srv/tmp --with-judgehost_judgedir=/srv/judgings --with-judgehost_chrootdir=/srv/chroot --with-judgehost_cgroupdir=/sys/fs/altcgroup --with-domserver_logdir=/log"
run run_configure "--with-judgehost_tmpdir=/srv/tmp --with-judgehost_judgedir=/srv/judgings --with-judgehost_chrootdir=/srv/chroot --with-domserver_logdir=/log"
assert_line " * prefix..............: /opt/domjudge"
assert_line " * documentation.......: /opt/domjudge/doc"
assert_line " * domserver...........: /opt/domjudge/domserver"
Expand All @@ -362,8 +358,6 @@ compile_assertions_finished () {
assert_line " - judge............: /srv/judgings"
refute_line " - chroot...........: /chroot/domjudge"
assert_line " - chroot...........: /srv/chroot"
refute_line " - cgroup...........: /sys/fs/cgroup"
assert_line " - cgroup...........: /sys/fs/altcgroup"
}

@test "Default URL not set, docs mention" {
Expand Down
3 changes: 0 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ if test "x$FHS_ENABLED" = xyes ; then
AC_SUBST(judgehost_tmpdir, /tmp)
AC_SUBST(judgehost_judgedir, $localstatedir/lib/${PACKAGE_TARNAME}/judgings)
AC_SUBST(judgehost_chrootdir, /chroot/${PACKAGE_TARNAME})
AC_SUBST(judgehost_cgroupdir, /sys/fs/cgroup)
fi

AC_SUBST(domjudge_docdir, $docdir)
Expand Down Expand Up @@ -241,7 +240,6 @@ AX_PATH(judgehost_rundir, [$judgehost_root/run])
AX_PATH(judgehost_tmpdir, [$judgehost_root/tmp])
AX_PATH(judgehost_judgedir, [$judgehost_root/judgings])
AX_PATH(judgehost_chrootdir, [/chroot/${PACKAGE_TARNAME}])
AX_PATH(judgehost_cgroupdir, [/sys/fs/cgroup])
fi
AX_WITH_COMMENT(7,[ ])

Expand Down Expand Up @@ -405,7 +403,6 @@ echo " - run..............: AX_VAR_EXPAND($judgehost_rundir)"
echo " - tmp..............: AX_VAR_EXPAND($judgehost_tmpdir)"
echo " - judge............: AX_VAR_EXPAND($judgehost_judgedir)"
echo " - chroot...........: AX_VAR_EXPAND($judgehost_chrootdir)"
echo " - cgroup...........: AX_VAR_EXPAND($judgehost_cgroupdir)"
fi
echo ""
echo " * systemd unit files..: AX_VAR_EXPAND($systemd_unitdir)"
Expand Down
1 change: 0 additions & 1 deletion etc/judgehost-static.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ define('RUNDIR', '@judgehost_rundir@');
define('TMPDIR', '@judgehost_tmpdir@');
define('JUDGEDIR', '@judgehost_judgedir@');
define('CHROOTDIR', '@judgehost_chrootdir@');
define('CGROUPDIR', '@judgehost_cgroupdir@');

define('RUNUSER', '@RUNUSER@');
define('RUNGROUP', '@RUNGROUP@');
Expand Down
2 changes: 1 addition & 1 deletion judge/create_cgroups.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# (hence: not the 'domjudge-run' user!)

JUDGEHOSTUSER=@DOMJUDGE_USER@
CGROUPBASE=@judgehost_cgroupdir@
CGROUPBASE="/sys/fs/cgroup"

cgroup_error_and_usage () {
echo "$1" >&2
Expand Down
2 changes: 0 additions & 2 deletions paths.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ judgehost_rundir = @judgehost_rundir@
judgehost_tmpdir = @judgehost_tmpdir@
judgehost_judgedir = @judgehost_judgedir@
judgehost_chrootdir = @judgehost_chrootdir@
judgehost_cgroupdir = @judgehost_cgroupdir@

domjudge_docdir = @domjudge_docdir@

Expand Down Expand Up @@ -153,7 +152,6 @@ define substconfigvars
-e 's,@judgehost_tmpdir[@],@judgehost_tmpdir@,g' \
-e 's,@judgehost_judgedir[@],@judgehost_judgedir@,g' \
-e 's,@judgehost_chrootdir[@],@judgehost_chrootdir@,g' \
-e 's,@judgehost_cgroupdir[@],@judgehost_cgroupdir@,g' \
-e 's,@domjudge_docdir[@],@domjudge_docdir@,g' \
-e 's,@systemd_unitdir[@],@systemd_unitdir@,g' \
-e 's,@DOMJUDGE_USER[@],@DOMJUDGE_USER@,g' \
Expand Down

0 comments on commit e6c58ec

Please sign in to comment.