clouddreamai-cicd-setup 1.5.38 → 1.5.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/scripts/deploy.sh +13 -2
package/package.json
CHANGED
|
@@ -393,10 +393,21 @@ create_database() {
|
|
|
393
393
|
fi
|
|
394
394
|
fi
|
|
395
395
|
|
|
396
|
+
# 检查 PostgreSQL 是否实际监听所有地址(配置可能已改但未重启)
|
|
397
|
+
if ! netstat -tlnp 2>/dev/null | grep -q "0.0.0.0:5432"; then
|
|
398
|
+
echo "检测到 PostgreSQL 未监听所有地址,需要重启..."
|
|
399
|
+
PG_RESTART_NEEDED=true
|
|
400
|
+
fi
|
|
401
|
+
|
|
396
402
|
if [ "$PG_RESTART_NEEDED" = true ]; then
|
|
397
403
|
echo "重启 PostgreSQL 服务..."
|
|
398
|
-
|
|
399
|
-
|
|
404
|
+
# 宝塔 PostgreSQL 需要用 postgres 用户重启,且必须用 restart 而非 reload 才能让 listen_addresses 生效
|
|
405
|
+
if [ -x "/www/server/pgsql/bin/pg_ctl" ]; then
|
|
406
|
+
sudo -u postgres /www/server/pgsql/bin/pg_ctl restart -D /www/server/pgsql/data -m fast 2>/dev/null || true
|
|
407
|
+
else
|
|
408
|
+
systemctl restart postgresql 2>/dev/null || /etc/init.d/postgresql restart 2>/dev/null || true
|
|
409
|
+
fi
|
|
410
|
+
sleep 3
|
|
400
411
|
echo "✓ PostgreSQL 配置已更新"
|
|
401
412
|
fi
|
|
402
413
|
|