From eaee7504438c6dbd484bf17c311ae2ff7b1c9f5e Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Thu, 30 Jul 2026 11:31:04 +0800 Subject: [PATCH] docs: add rule - deploy must check systemctl is-active after stop, no fixed sleep --- AGENTS.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 5867dde..42512f5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -128,3 +128,10 @@ The config preview rendering pipeline: merge template + profile + overlays → r - **Git push 失败重试**:HTTP 凭证偶尔过期,push 失败后再执行一次即可(第二次会弹出 Windows 凭据框)。 - **多行 bash 命令必须用 `\` 续行**:写给用户复制粘贴的 bash 命令,多行时每行末尾加 `\`,保持代码块内只有纯命令,不夹杂说明文字。单行不超过 120 字符,方便 UU 远程等终端工具可靠粘贴执行。 +- **部署服务必须分步确认**:`systemctl stop` 后必须循环检查 `systemctl is-active` 返回 `inactive` 或 `failed` 才能继续。不能依赖固定 sleep 时间,不能多条命令用 `&&` 串在一起。正确模式: + ```bash + sudo systemctl stop xxx + while systemctl is-active xxx >/dev/null 2>&1; do sleep 1; done + sudo cp new-binary /opt/xxx/bin/ + sudo systemctl start xxx + ```