Skip to content

Commit

Permalink
Fix systemd config in hgtest
Browse files Browse the repository at this point in the history
  • Loading branch information
taoky committed Aug 11, 2023
1 parent 384f357 commit ca4adb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 3 additions & 1 deletion conf/systemd/[email protected]
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[Unit]
# available options:
# [email protected], or [email protected]
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
Expand Down

0 comments on commit ca4adb2

Please sign in to comment.