feat: add cloud deploy fallback runtime

This commit is contained in:
Codex
2026-03-23 13:25:56 +08:00
parent 3ff757e22d
commit bc04c439fb
7 changed files with 120 additions and 6 deletions

24
scripts/server_stop.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail
data_dir="${BOSS_DATA_DIR:-.boss-data}"
pid_file="${BOSS_PID_FILE:-$data_dir/server.pid}"
if [[ ! -f "$pid_file" ]]; then
echo "No Boss PID file found."
exit 0
fi
pid="$(cat "$pid_file")"
if [[ -n "$pid" ]] && kill -0 "$pid" 2>/dev/null; then
kill "$pid"
for _ in {1..20}; do
if ! kill -0 "$pid" 2>/dev/null; then
break
fi
sleep 1
done
fi
rm -f "$pid_file"
echo "Boss server stopped."