feat: completar despliegue en produccion CT 132 con supervision de SIAX Monitor y reinicio atomico

This commit is contained in:
2026-10-19 23:55:21 -05:00
parent 55608c1abe
commit 035238c08d
5 changed files with 36 additions and 12 deletions
+17 -4
View File
@@ -27,7 +27,17 @@ mkdir -p "$SCRIPT_DIR/data/uploads"
# 3. Permisos de ejecución al binario
chmod +x "$SCRIPT_DIR/app_compartir"
# 4. Modo de arranque: Si existe servicio systemd de SIAX Monitor o estándar, usarlo; de lo contrario, tmux
# 4. Modo de arranque: SIAX Monitor API, systemd o tmux
if curl -sI http://localhost:8080/api/apps 2>/dev/null | grep -q "200 OK"; then
echo "==> Reiniciando DROP_SIGMAC_APP vía API de SIAX Monitor (:8080)..."
RESP=$(curl -s -X POST http://localhost:8080/api/apps/DROP_SIGMAC_APP/restart)
echo " Respuesta: $RESP"
if echo "$RESP" | grep -q '"success":true'; then
echo "✅ Servicio reiniciado exitosamente por SIAX Monitor."
exit 0
fi
fi
SERVICE_NAME=""
if systemctl is-active --quiet siax-app-DROP_SIGMAC_APP.service 2>/dev/null || [ -f /etc/systemd/system/siax-app-DROP_SIGMAC_APP.service ]; then
SERVICE_NAME="siax-app-DROP_SIGMAC_APP.service"
@@ -36,9 +46,12 @@ elif systemctl is-active --quiet drop-sigmac-app.service 2>/dev/null || [ -f /et
fi
if [[ -n "$SERVICE_NAME" ]]; then
echo "==> Reiniciando servicio systemd '$SERVICE_NAME' (SIAX Monitor)..."
sudo systemctl restart "$SERVICE_NAME"
sudo systemctl status "$SERVICE_NAME" --no-pager
echo "==> Reiniciando servicio systemd '$SERVICE_NAME'..."
if sudo -n true 2>/dev/null; then
sudo systemctl restart "$SERVICE_NAME"
else
systemctl restart "$SERVICE_NAME" 2>/dev/null || true
fi
exit 0
fi