-
Notifications
You must be signed in to change notification settings - Fork 4
/
run.sh
executable file
·17 lines (15 loc) · 730 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
if [ `id -u` -ne 0 ]; then
echo "Please re-run ${this_file} as root."
exit 1
fi
core=$(grep --count ^processor /proc/cpuinfo)
n=$(($core*2))
echo "username:" $USERNAME > config/token.yaml
echo "password:" $PASSWORD >> config/token.yaml
./nsjail/setup.sh
chown compiler -R /sys/fs/cgroup/memory/NSJAIL /sys/fs/cgroup/cpu/NSJAIL /sys/fs/cgroup/pids/NSJAIL
chgrp compiler -R /sys/fs/cgroup/memory/NSJAIL /sys/fs/cgroup/cpu/NSJAIL /sys/fs/cgroup/pids/NSJAIL
chown compiler:compiler run/log run/tmp run/sub run/spj
gunicorn flask_server:flask_app --workers $n --worker-connections 1000 --error-logfile /ejudge/run/log/gunicorn.log \
--timeout 600 --log-level warning -u compiler -g compiler --bind 0.0.0.0:5000