docs: add rule - deploy must check systemctl is-active after stop, no fixed sleep
This commit is contained in:
parent
35c413367f
commit
eaee750443
@ -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
|
||||
```
|
||||
|
||||
Loading…
Reference in New Issue
Block a user