增强一键部署容错
This commit is contained in:
parent
b1aae8aac4
commit
4317dd9a02
@ -220,11 +220,23 @@ python3 -m venv .venv
|
|||||||
.venv/bin/pip install --quiet --disable-pip-version-check -r requirements-ops.txt
|
.venv/bin/pip install --quiet --disable-pip-version-check -r requirements-ops.txt
|
||||||
|
|
||||||
bash scripts/install_systemd.sh
|
bash scripts/install_systemd.sh
|
||||||
systemctl reset-failed hy-app-monitor-yumi.service hy-app-monitor-haiyi.service hy-app-monitor.service || true
|
|
||||||
systemctl restart hy-app-monitor-yumi.service hy-app-monitor-haiyi.service hy-app-monitor.service
|
restart_unit() {{
|
||||||
systemctl is-active hy-app-monitor-yumi.service
|
local unit="$1"
|
||||||
systemctl is-active hy-app-monitor-haiyi.service
|
# 先清理一次可能残留的 start-limit 状态。
|
||||||
systemctl is-active hy-app-monitor.service
|
systemctl reset-failed "$unit" || true
|
||||||
|
# 优先直接重启;如果被限流或中途失败,再补一次 reset/start。
|
||||||
|
if ! systemctl restart "$unit"; then
|
||||||
|
systemctl reset-failed "$unit" || true
|
||||||
|
systemctl start "$unit"
|
||||||
|
fi
|
||||||
|
# 每个服务都单独校验 active,避免批量命令掩盖具体失败项。
|
||||||
|
systemctl is-active "$unit"
|
||||||
|
}}
|
||||||
|
|
||||||
|
restart_unit hy-app-monitor-yumi.service
|
||||||
|
restart_unit hy-app-monitor-haiyi.service
|
||||||
|
restart_unit hy-app-monitor.service
|
||||||
ss -lntp | grep ":$APP_PORT" || true
|
ss -lntp | grep ":$APP_PORT" || true
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user