diff --git a/README.md b/README.md index 2d1e961..da1e81c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ 生产环境中会额外用到:Nginx、uWSGI、PostgreSQL、Memcached。以下流程在 Debian 12 测试过。 -1. 安装依赖:`apt install python3-dev python3-venv nginx postgresql memcached`。 +1. 安装依赖:`apt install python3-dev build-essential python3-venv nginx postgresql memcached`。 1. (建议)本地连接 PostgreSQL 无需鉴权:修改 `/etc/postgresql/15/main/pg_hba.conf`,将 `local all all peer` 一行改为 `local all all trust`,然后执行 `systemctl reload postgresql`。 1. 创建数据库:`su postgres`,`psql`,`create user hackergame; create database hackergame;`, `\c hackergame`, `grant create on schema public to hackergame;`。 1. 克隆代码:`cd /opt`,`git clone https://github.com/ustclug/hackergame.git`。 diff --git a/conf/systemd/hackergame@.service b/conf/systemd/hackergame@.service index c0e8dba..3efb56f 100644 --- a/conf/systemd/hackergame@.service +++ b/conf/systemd/hackergame@.service @@ -1,9 +1,11 @@ [Unit] +# available options: +# hackergame@hackergame.service, or hackergame@hgtest.service Description=Hackergame Platform (%i) After=syslog.target [Service] -ExecStart=/opt/hackergame/.venv/bin/uwsgi --ini /opt/hackergame/conf/uwsgi-apps/%i.ini --ini /opt/hackergame/conf/uwsgi.ini --set-placeholder appname=%i --daemonize /var/log/uwsgi/app/%i.log +ExecStart=/opt/%i/.venv/bin/uwsgi --ini /opt/%i/conf/uwsgi-apps/%i.ini --ini /opt/%i/conf/uwsgi.ini --set-placeholder appname=%i --daemonize /var/log/uwsgi/app/%i.log ExecReload=/bin/kill -HUP $MAINPID LogsDirectory=uwsgi/app RuntimeDirectory=uwsgi/app/%i