diff --git a/deploy/README.md b/deploy/README.md index 4b90f3c..809f187 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -68,7 +68,14 @@ cd /home/bestmidi/chgrid Logs: ```bash -journalctl -u chgrid-signaling.service -f +journalctl -u chat-grid.service -f +``` + +If you previously used `chgrid-signaling.service`, migrate once: + +```bash +sudo systemctl disable --now chgrid-signaling.service +sudo systemctl daemon-reload ``` ## 6) Apache websocket proxy @@ -139,8 +146,8 @@ git pull --ff-only origin main ./deploy/scripts/install_server.sh /home/bestmidi/chgrid # Restart signaling service -sudo systemctl restart chgrid-signaling.service -journalctl -u chgrid-signaling.service -n 50 --no-pager +sudo systemctl restart chat-grid.service +journalctl -u chat-grid.service -n 50 --no-pager ``` Notes: diff --git a/deploy/scripts/install_service.sh b/deploy/scripts/install_service.sh index 145eebf..d7f470f 100755 --- a/deploy/scripts/install_service.sh +++ b/deploy/scripts/install_service.sh @@ -2,7 +2,7 @@ set -euo pipefail REPO_ROOT="${1:-/home/bestmidi/chgrid}" -UNIT_NAME="${2:-chgrid-signaling.service}" +UNIT_NAME="${2:-chat-grid.service}" SRC_UNIT="$REPO_ROOT/deploy/systemd/$UNIT_NAME" DST_UNIT="/etc/systemd/system/$UNIT_NAME" diff --git a/deploy/systemd/chat-grid.service b/deploy/systemd/chat-grid.service new file mode 100644 index 0000000..53b8654 --- /dev/null +++ b/deploy/systemd/chat-grid.service @@ -0,0 +1,16 @@ +[Unit] +Description=Chat Grid signaling server +After=network.target + +[Service] +Type=simple +User=bestmidi +Group=bestmidi +WorkingDirectory=/home/bestmidi/chgrid/server +Environment=PATH=/home/bestmidi/chgrid/server/.venv/bin:/usr/bin:/bin +ExecStart=/home/bestmidi/chgrid/server/.venv/bin/python main.py --config /home/bestmidi/chgrid/server/config.toml +Restart=always +RestartSec=3 + +[Install] +WantedBy=multi-user.target