Hi Marc,
On 25-10-15 17:01, Marc Furon wrote:
Greetings! I am configuring DOMjudge 5.0.1 in a Fedora 22 64-bit environment. Most things seem to be working.
I am trying to get Oracle Java 8u60 to run correctly in a "chroot" environment. I built the chroot directory more-or-less manually, installing Java into it (under /opt) and copying the necessary library files. I also copied /bin/bash into the chroot area along with its necessary library, and linked sh to bash. I edited the java_javac_detect script to run /opt/java/bin/java as "program".
If I run a chroot command from the shell, bash starts, and I can run "/opt/java/bin/java -version". It complains about the lack of a monotonic clock but otherwise seems to run.
I then tried to run the "Hello World" tests. C and C++ work fine. Java fails. I went into the execution directory and the program.err file says that it could not exec /opt/java/bin/java.
Has anyone tried to get this kind of configuration running? Any ideas about how to best configure Java in this environment? Suggestions will be greatly appreciated.
Ah, that doesn't work since only a few select subdirectories of the chroot tree are actually mounted into the chroot environment (which is created again for each judging). See lib/judge/chroot-start-stop.sh (or without lib/ in the source tree), these dirs are:
etc, usr, lib, (lib64), proc
Since opt is not in that list, the java binary will not be available during testing.
The simplest fix would be to add opt to the list SUBDIRMOUNTS. This should not cause any problems except that it exposes a little more to the submission running inside the chroot environment.
Jaap