fix: освобождать порт 3000 перед запуском shop.service
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -78,6 +78,9 @@ fi
|
||||
systemctl daemon-reload
|
||||
systemctl enable shop
|
||||
|
||||
systemctl stop shop 2>/dev/null || true
|
||||
bash "$SCRIPT_DIR/free-port-3000.sh" 3000
|
||||
|
||||
echo "Запуск shop..."
|
||||
if ! systemctl restart shop; then
|
||||
echo ""
|
||||
@@ -89,13 +92,20 @@ if ! systemctl restart shop; then
|
||||
fi
|
||||
|
||||
sleep 3
|
||||
if curl -sf http://127.0.0.1:3000/health; then
|
||||
echo ""
|
||||
echo "OK — служба shop запущена"
|
||||
systemctl status shop --no-pager | head -15
|
||||
systemctl reload caddy 2>/dev/null || true
|
||||
else
|
||||
echo "shop не отвечает на :3000"
|
||||
|
||||
if ! systemctl is-active --quiet shop; then
|
||||
echo "shop.service не в состоянии active"
|
||||
journalctl -u shop -n 40 --no-pager
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if curl -sf http://127.0.0.1:3000/health; then
|
||||
echo ""
|
||||
echo "OK — служба shop запущена (systemd active)"
|
||||
systemctl status shop --no-pager | head -15
|
||||
systemctl reload caddy 2>/dev/null || true
|
||||
else
|
||||
echo "health не отвечает"
|
||||
journalctl -u shop -n 40 --no-pager
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user