From db51cb12e2197dbe78b723281e51912b7550d60b Mon Sep 17 00:00:00 2001 From: xehoth <824547322@qq.com> Date: Thu, 15 Jun 2017 18:34:06 +0800 Subject: [PATCH 1/2] Add LuaJIT Support Add LuaJIT 2.0.4 Support --- config-example.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config-example.json b/config-example.json index c3df2b3..5600eb3 100644 --- a/config-example.json +++ b/config-example.json @@ -85,6 +85,12 @@ "version": "Lua 5.2.4", "editor": "lua" }, + "luajit": { + "show": "LuaJIT", + "highlight": "lua", + "version": "LuaJIT 2.0.4", + "editor": "lua" + }, "python2": { "show": "Python 2", "highlight": "python", From 7129a920e546e547e2b57a40f4266cb69d69136b Mon Sep 17 00:00:00 2001 From: xehoth <824547322@qq.com> Date: Thu, 15 Jun 2017 19:17:18 +0800 Subject: [PATCH 2/2] Update README --- README.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/README.md b/README.md index 243e2f4..eafb630 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,90 @@ To make a user be an admin, the only way is via database. # Judge SYZOJ 2 uses a Docker-based sandboxed judger. Please go to [syzoj-judge](https://github.com/syzoj/syzoj-judge). + +# Advanced +## System Service +### Run SYZOJ 2 +Add SYZOJ 2 to system services. +``` bash +vim [syzoj2 path]/runsyzoj +``` +Edit `runsyzoj` as as follows. +``` bash +#!/bin/bash +cd [syzoj2 path] +npm start > log.txt 2>&1 +``` +**Please change `[syzoj2 path]`.** +### Run SYZOJ-JUDGE +Add SYZOJ-JUDGE to system services. +``` bash +vim [syzoj-judge path]/runjudge +``` +Edit `runjudge` as as follows. +``` bash +#!/bin/bash +cd [syzoj-judge path] +npm start > jlog.txt 2>&1 +``` +**Please change `[syzoj-judge path]`.** +### Add To System Service +``` bash +vim /etc/systemd/system/syzoj.service +``` +Edit `/etc/systemd/system/syzoj.service` as as follows. +``` bash +[Unit] +Description=SYZOJ Online Judge +After=network.target + +[Service] +Type=simple +PIDFile=/run/syzoj.pid +WorkingDirectory=[syzoj2 path] +ExecStart=[syzoj2 path]/runsyzoj +StandardOutput=null +StandardError=null + +[Install] +WantedBy=multi-user.target +``` +**Please change `[syzoj2 path]`.** + +``` bash +vim /etc/systemd/system/syzoj-judge.service +``` +Edit `/etc/systemd/system/syzoj-judge.service` as as follows. +``` bash +[Unit] +Description=SYZOJ Judge Daemon +After=network.target + +[Service] +Type=simple +PIDFile=/run/syzoj-judge.pid +WorkingDirectory=[syzoj-judge path] +ExecStart=[syzoj-judge path]/runjudge +StandardOutput=null +StandardError=null + +[Install] +WantedBy=multi-user.target +``` +**Please change `[syzoj-judge path]`.** +### Usage +#### Start +``` bash +systemctl start syzoj +systemctl start syzoj-judge +``` +#### Stop +``` bash +systemctl stop syzoj +systemctl stop syzoj-judge +``` +#### Restart +``` bash +systemctl restart syzoj +systemctl restart syzoj-judge +```