fix: освобождать порт 3000 перед запуском shop.service

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
shop
2026-05-17 13:31:56 +03:00
parent f13ec7f29a
commit d31a63829c
6 changed files with 87 additions and 11 deletions
+20
View File
@@ -52,6 +52,26 @@ cp /opt/shop/shop10.bak.*/.env /opt/shop/shop10/.env 2>/dev/null || cp /opt/shop
bash /opt/shop/shop10/scripts/server-update.sh
```
## shop.service: exit-code / activating (auto-restart)
**Health ответил OK, но systemd падает** — часто порт 3000 занят старым `npm start`:
```bash
cd /opt/shop/shop10
git pull
sudo bash scripts/free-port-3000.sh
sudo systemctl restart shop
systemctl status shop
```
Лог:
```bash
journalctl -u shop -n 30 --no-pager
# EADDRINUSE → free-port-3000.sh
# MODULE_NOT_FOUND → npm install --omit=dev
```
## Job for shop.service failed (control process exited)
Чаще всего не запущен PostgreSQL или не прошёл `ExecStartPre`: