fix: runtime anomaly handling for overnight startup and monitor (#396 #397) #404

Merged
jihoson merged 6 commits from feature/issue-396-397-runtime-anomaly-fixes into main 2026-03-04 02:46:38 +09:00
Showing only changes of commit 370ee8cc85 - Show all commits

View File

@@ -36,7 +36,7 @@ WATCHDOG_PID_FILE="$LOG_DIR/watchdog.pid"
is_port_in_use() { is_port_in_use() {
local port="$1" local port="$1"
ss -ltn 2>/dev/null | rg -q ":${port}\\b" ss -ltn 2>/dev/null | grep -Eq ":${port}[[:space:]]"
} }
if [ -f "$PID_FILE" ]; then if [ -f "$PID_FILE" ]; then
@@ -53,7 +53,8 @@ if [[ "$APP_CMD" == *"--dashboard"* ]] && is_port_in_use "$dashboard_port"; then
exit 1 exit 1
fi fi
nohup bash -lc "exec $APP_CMD" >>"$RUN_LOG" 2>&1 & # `env` keeps inline VAR=value prefixes in APP_CMD working with `exec`.
nohup bash -lc "exec env $APP_CMD" >>"$RUN_LOG" 2>&1 &
app_pid=$! app_pid=$!
echo "$app_pid" > "$PID_FILE" echo "$app_pid" > "$PID_FILE"