mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 07:38:42 +00:00
fix(judger): Let judger work on ubuntu 20.04 (#81)
* Fix judger/log/
* fix(judger): Let judger work on ubuntu 20.04
Judger stops working since 9a6f16cf1d
, this commit allows judger continue working.
* fix(web): update faq.php
This commit is contained in:
parent
588b3bf01f
commit
0cc5f87058
@ -5,7 +5,7 @@ ARG CLONE_ADDFLAG
|
|||||||
WORKDIR /opt
|
WORKDIR /opt
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
#Update apt and install git
|
#Update apt and install git
|
||||||
RUN apt-get update && apt-get install -y apache2 cmake curl fp-compiler g++ git gnupg libapache2-mod-php libapache2-mod-xsendfile libyaml-dev make mysql-server ntp openjdk-11-jdk openjdk-8-jdk php php-dev php-mbstring php-mysql php-pear php-zip python python3 python3-requests re2c unzip vim wget zip
|
RUN apt-get update && apt-get install -y apache2 cmake curl fp-compiler g++ git gnupg libapache2-mod-php libapache2-mod-xsendfile libyaml-dev make mysql-server ntp openjdk-11-jdk openjdk-8-jdk php php-dev php-mbstring php-mysql php-pear php-zip python python3 python3-requests re2c unzip vim wget zip --no-install-recommends
|
||||||
#Clone the latest UOJ Community verison to local
|
#Clone the latest UOJ Community verison to local
|
||||||
RUN git clone https://github.com/UniversalOJ/UOJ-System.git --depth 1 --single-branch ${CLONE_ADDFLAG} uoj
|
RUN git clone https://github.com/UniversalOJ/UOJ-System.git --depth 1 --single-branch ${CLONE_ADDFLAG} uoj
|
||||||
#Install environment and set startup script
|
#Install environment and set startup script
|
||||||
|
@ -83,6 +83,10 @@ UOJEOF
|
|||||||
|
|
||||||
setJudgeConf(){
|
setJudgeConf(){
|
||||||
printf "\n\n==> Setting judger files\n"
|
printf "\n\n==> Setting judger files\n"
|
||||||
|
#specify environment
|
||||||
|
cat > /etc/environment <<UOJEOF
|
||||||
|
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
|
UOJEOF
|
||||||
#Add local_main_judger user
|
#Add local_main_judger user
|
||||||
useradd -m local_main_judger && usermod -a -G www-data local_main_judger
|
useradd -m local_main_judger && usermod -a -G www-data local_main_judger
|
||||||
#Set uoj_data path
|
#Set uoj_data path
|
||||||
|
3
judger/.gitignore
vendored
3
judger/.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
.conf.json
|
.conf.json
|
||||||
log
|
log/*
|
||||||
|
!/log/.gitkeep
|
||||||
uoj_judger/builtin/checker/*
|
uoj_judger/builtin/checker/*
|
||||||
!uoj_judger/builtin/checker/*.cpp
|
!uoj_judger/builtin/checker/*.cpp
|
||||||
!uoj_judger/builtin/checker/*.h
|
!uoj_judger/builtin/checker/*.h
|
||||||
|
0
judger/log/.gitkeep
Normal file
0
judger/log/.gitkeep
Normal file
@ -193,6 +193,7 @@ int syscall_max_cnt_list_default[][2] = {
|
|||||||
{__NR_write , -1},
|
{__NR_write , -1},
|
||||||
{__NR_readv , -1},
|
{__NR_readv , -1},
|
||||||
{__NR_writev , -1},
|
{__NR_writev , -1},
|
||||||
|
{__NR_pread64 , -1},
|
||||||
{__NR_open , -1},
|
{__NR_open , -1},
|
||||||
{__NR_unlink , -1},
|
{__NR_unlink , -1},
|
||||||
{__NR_close , -1},
|
{__NR_close , -1},
|
||||||
@ -395,7 +396,7 @@ void init_conf(const RunProgramConfig &config) {
|
|||||||
statable_file_name_set.insert("/usr/bin");
|
statable_file_name_set.insert("/usr/bin");
|
||||||
statable_file_name_set.insert("/usr/lib");
|
statable_file_name_set.insert("/usr/lib");
|
||||||
# ifdef UOJ_JUDGER_BASESYSTEM_UBUNTU1804
|
# ifdef UOJ_JUDGER_BASESYSTEM_UBUNTU1804
|
||||||
statable_file_name_set.insert("/usr/lib/python36.zip");
|
statable_file_name_set.insert("/usr/lib/python38.zip");
|
||||||
# endif
|
# endif
|
||||||
} else if (config.type == "java8") {
|
} else if (config.type == "java8") {
|
||||||
syscall_max_cnt[__NR_gettid ] = -1;
|
syscall_max_cnt[__NR_gettid ] = -1;
|
||||||
@ -408,6 +409,7 @@ void init_conf(const RunProgramConfig &config) {
|
|||||||
syscall_max_cnt[__NR_clone ] = 13;
|
syscall_max_cnt[__NR_clone ] = 13;
|
||||||
|
|
||||||
syscall_max_cnt[__NR_getdents ] = 4;
|
syscall_max_cnt[__NR_getdents ] = 4;
|
||||||
|
syscall_max_cnt[__NR_getdents64 ] = 4;
|
||||||
|
|
||||||
syscall_max_cnt[__NR_clock_getres ] = 2;
|
syscall_max_cnt[__NR_clock_getres ] = 2;
|
||||||
|
|
||||||
@ -455,6 +457,7 @@ void init_conf(const RunProgramConfig &config) {
|
|||||||
syscall_max_cnt[__NR_clone ] = 14;
|
syscall_max_cnt[__NR_clone ] = 14;
|
||||||
|
|
||||||
syscall_max_cnt[__NR_getdents ] = 4;
|
syscall_max_cnt[__NR_getdents ] = 4;
|
||||||
|
syscall_max_cnt[__NR_getdents64 ] = 4;
|
||||||
|
|
||||||
syscall_max_cnt[__NR_clock_getres ] = 2;
|
syscall_max_cnt[__NR_clock_getres ] = 2;
|
||||||
|
|
||||||
@ -474,6 +477,7 @@ void init_conf(const RunProgramConfig &config) {
|
|||||||
syscall_max_cnt[__NR_pread64 ] = -1;
|
syscall_max_cnt[__NR_pread64 ] = -1;
|
||||||
syscall_max_cnt[__NR_prctl ] = -1;
|
syscall_max_cnt[__NR_prctl ] = -1;
|
||||||
syscall_max_cnt[__NR_nanosleep ] = -1;
|
syscall_max_cnt[__NR_nanosleep ] = -1;
|
||||||
|
syscall_max_cnt[__NR_clock_nanosleep] = -1;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
syscall_should_soft_ban[__NR_socket ] = true;
|
syscall_should_soft_ban[__NR_socket ] = true;
|
||||||
@ -518,6 +522,7 @@ void init_conf(const RunProgramConfig &config) {
|
|||||||
|
|
||||||
syscall_max_cnt[__NR_setrlimit ] = -1;
|
syscall_max_cnt[__NR_setrlimit ] = -1;
|
||||||
syscall_max_cnt[__NR_pipe ] = -1;
|
syscall_max_cnt[__NR_pipe ] = -1;
|
||||||
|
syscall_max_cnt[__NR_pipe2 ] = -1;
|
||||||
|
|
||||||
syscall_max_cnt[__NR_getdents64 ] = -1;
|
syscall_max_cnt[__NR_getdents64 ] = -1;
|
||||||
syscall_max_cnt[__NR_getdents ] = -1;
|
syscall_max_cnt[__NR_getdents ] = -1;
|
||||||
@ -544,6 +549,7 @@ void init_conf(const RunProgramConfig &config) {
|
|||||||
syscall_max_cnt[__NR_pread64 ] = -1;
|
syscall_max_cnt[__NR_pread64 ] = -1;
|
||||||
syscall_max_cnt[__NR_prctl ] = -1;
|
syscall_max_cnt[__NR_prctl ] = -1;
|
||||||
syscall_max_cnt[__NR_nanosleep ] = -1;
|
syscall_max_cnt[__NR_nanosleep ] = -1;
|
||||||
|
syscall_max_cnt[__NR_clock_nanosleep] = -1;
|
||||||
syscall_max_cnt[__NR_socketpair ] = -1;
|
syscall_max_cnt[__NR_socketpair ] = -1;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
@ -47,13 +47,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="collapseThree" class="collapse">
|
<div id="collapseThree" class="collapse">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p>默认的测评环境是 Ubuntu Linux 18.04 LTS x64。</p>
|
<p>默认的测评环境是 Ubuntu Linux 20.04 LTS x64。</p>
|
||||||
<p>C的编译器是 gcc 7.4.0,编译命令:<code>gcc code.c -o code -lm -O2 -DONLINE_JUDGE</code>。</p>
|
<p>C的编译器是 gcc 9.3.0,编译命令:<code>gcc code.c -o code -lm -O2 -DONLINE_JUDGE</code>。</p>
|
||||||
<p>C++的编译器是 g++ 7.4.0,编译命令:<code>g++ code.cpp -o code -lm -O2 -DONLINE_JUDGE</code>。如果选择C++11会在编译命令后面添加<code>-std=c++11</code>。</p>
|
<p>C++的编译器是 g++ 9.3.0,编译命令:<code>g++ code.cpp -o code -lm -O2 -DONLINE_JUDGE</code>。如果选择C++11会在编译命令后面添加<code>-std=c++11</code>。</p>
|
||||||
<p>Java8的JDK版本是 openjdk 1.8.0_222,编译命令:<code>javac code.java</code>。</p>
|
<p>Java8的JDK版本是 openjdk 1.8.0_275,编译命令:<code>javac code.java</code>。</p>
|
||||||
<p>Java11的JDK版本是 openjdk 11.0.4,编译命令:<code>javac code.java</code>。</p>
|
<p>Java11的JDK版本是 openjdk 11.0.9,编译命令:<code>javac code.java</code>。</p>
|
||||||
<p>Pascal的编译器是 fpc 3.0.4,编译命令:<code>fpc code.pas -O2</code>。</p>
|
<p>Pascal的编译器是 fpc 3.0.4,编译命令:<code>fpc code.pas -O2</code>。</p>
|
||||||
<p>Python会先编译为优化过的字节码<samp>.pyo</samp>文件。支持的Python版本分别为Python 2.7和3.6。</p>
|
<p>Python会先编译为优化过的字节码<samp>.pyo</samp>文件。支持的Python版本分别为Python 2.7和3.8。</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user