fix(scripts): ctrl.sh restart 不再挂起超时——启动后 disown 剔除后台 job,脚本立即返回
This commit is contained in:
1 parent
9e4e6e623f
commit
5dfaa75a06
1 file changed
+5
-1
+5
-1
@@ -62,7 +62,11 @@ start() {
|
||||
fi
|
||||
[ -x "$APP_BIN" ] || { echo "未找到二进制 $APP_BIN,请先 go build"; return 1; }
|
||||
echo "启动 cyrene → $APP_BIN (端口 $GW_PORT)"
|
||||
( cd "$REPO" && setsid nohup "$APP_BIN" > "$LOG_FILE" 2>&1 < /dev/null & )
|
||||
# setsid 只脱离会话,但 cyrene 仍是本 bash 的后台 job;脚本退出时 bash 会等待
|
||||
# 它结束,导致 restart 命令"挂起超时"。disown 把它从作业表剔除,脚本立即返回。
|
||||
cd "$REPO" || return 1
|
||||
setsid nohup "$APP_BIN" > "$LOG_FILE" 2>&1 < /dev/null &
|
||||
disown
|
||||
# 等待健康
|
||||
local i
|
||||
for i in $(seq 1 20); do
|
||||
|
||||
Reference in new issue
Block a user