Skip to content

Commit

Permalink
Remove installation of service files
Browse files Browse the repository at this point in the history
For FHS install the chosen option is most likely incorrect and in case
someone uses a prefix the files would most of the time still need to be
installed outside of that prefix. The same method as
for the webserver files will be used, so present the option to copy them
yourself as sysadmin on the machine both in the Makefile and in the
documentation.

Co-authored-by: Jaap Eldering <[email protected]>
  • Loading branch information
vmcj and eldering committed Jul 27, 2024
1 parent 9c2bb99 commit ec7ca6c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 28 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@ endif
# Fix permissions and ownership for password files:
-$(INSTALL_USER) -m 0600 -t $(DESTDIR)$(judgehost_etcdir) \
etc/restapi.secret
@echo ""
@echo "========== Judgehost Install Completed =========="
@echo ""
@echo "Optionally:"
@echo " - Install the create-cgroup service to setup the secure judging restrictions:"
@echo " cp judge/create-cgroups.service /etc/systemd/system/"
@echo " - Install the judgehost service:"
@echo " cp judge/[email protected] /etc/systemd/system/"
@echo " - You can enable the judgehost on CPU core 1 with:"
@echo " systemctl enable domjudge-judgedaemon@1"
@echo ""

check-root:
@if [ `id -u` -ne 0 -a -z "$(QUIET)" ]; then \
Expand Down
23 changes: 0 additions & 23 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -243,26 +243,6 @@ AX_WITH_COMMENT(7,[ ])

# }}}

# {{{ Directory for systemd unit files

PKG_PROG_PKG_CONFIG()
AC_ARG_WITH([systemdsystemunitdir],
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
[with_systemdsystemunitdir=auto])
AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
AS_IF([test "x$PKG_CONFIG" = "x"],AC_MSG_ERROR([systemd support requested but no pkg-config available to query systemd package]))
def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
AS_IF([test "x$def_systemdsystemunitdir" = "x"],
[AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
[AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
with_systemdsystemunitdir=no],
[with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
[AC_SUBST([systemd_unitdir], [$with_systemdsystemunitdir])])

# }}}

AC_MSG_CHECKING([baseurl])
AC_ARG_WITH([baseurl], [AS_HELP_STRING([--with-baseurl=URL],
[Base URL of the DOMjudge web interfaces. Example default:
Expand Down Expand Up @@ -401,9 +381,6 @@ echo " - tmp..............: AX_VAR_EXPAND($judgehost_tmpdir)"
echo " - judge............: AX_VAR_EXPAND($judgehost_judgedir)"
echo " - chroot...........: AX_VAR_EXPAND($judgehost_chrootdir)"
fi
echo ""
echo " * systemd unit files..: AX_VAR_EXPAND($systemd_unitdir)"
echo ""
echo "Run 'make' without arguments to get a list of (build) targets."
echo ""
if test "x$BASEURL_UNCONFIGURED" = x1 ; then
Expand Down
9 changes: 9 additions & 0 deletions doc/manual/install-judgehost.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ example to install DOMjudge in the directory ``domjudge`` under `/opt`::
make judgehost
sudo make install-judgehost

Example service files for the judgehost and the judgedaemon are provided in
``judge/create-cgroups.service`` and ``judge/[email protected]``. The rest of the manual assumes you install those
in a location which is picked up by ``systemd``, for example ``/etc/systemd/system``.

.. parsed-literal::
cp judge/[email protected] /etc/systemd/system/
cp judge/create-cgroups.service /etc/systemd/system/
The judgedaemon can be run on various hardware configurations;

- A virtual machine, typically these have 1 or 2 cores and no hyperthreading, because the kernel will schedule its own tasks on CPU 0, we advice CPU 1,
Expand Down
5 changes: 0 additions & 5 deletions judge/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ install-judgehost:
judgedaemon.main.php run-interactive.sh
$(INSTALL_PROG) -t $(DESTDIR)$(judgehost_bindir) \
judgedaemon runguard runpipe create_cgroups
ifneq ($(systemd_unitdir),)
$(INSTALL_DIR) $(DESTDIR)$(systemd_unitdir)
$(INSTALL_DATA) -t $(DESTDIR)$(systemd_unitdir) \
create-cgroups.service domjudge-judgehost.target [email protected]
endif

clean-l:
-rm -f $(TARGETS) $(TARGETS:%=%$(OBJEXT))
Expand Down

0 comments on commit ec7ca6c

Please sign in to comment.