Files
metin2-client/tools/server/sbtest/restart.sh
T
shenleiandClaude Opus 5.5 657e49e52a Switchbot: sbtest isolated test cluster scripts + live test results
tools/server/sbtest/{setup,restart,rollback}.sh build and manage the isolated
203 test cluster (db :15040, auth :11040, channel5 on *_sb schemas with the
unlocked AVA2 protos). Docs record the channel5/sbtest switchbot results:
weapon, ring, talisman, relog (cache + MySQL), same-core warp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:03:07 +09:00

24 lines
927 B
Bash

#!/bin/sh
# (Re)starts the sbtest cluster in order db, auth, channel5 (README.md). Restarting empties the db cache,
# so the next login reads everything from MySQL.
set -eu
R=/usr/metin2/server
T=$R/sbtest
C5=$R/channel5/first
grep -q '^DB_PORT: 15040' $C5/CONFIG || { echo "channel5 is not on the sbtest db; run setup.sh" >&2; exit 1; }
for d in $C5 $T/auth $T/db; do
[ -f $d/pid ] || continue
p=$(cat $d/pid)
kill -0 "$p" 2>/dev/null || continue
kill -1 "$p"
i=0; while kill -0 "$p" 2>/dev/null && [ $i -lt 40 ]; do sleep 1; i=$((i+1)); done
echo "$d stopped after ${i}s"
done
daemon -f sh -c "cd $T/db && exec ./db > stdout 2>&1"; sleep 6
daemon -f sh -c "cd $T/auth && exec ./auth > stdout 2>&1"; sleep 4
daemon -f sh -c "cd $C5 && exec ./game > stdout 2>&1"; sleep 12
sockstat -l | grep -E ':(15040|11040|12040|13040|14040) '
echo "live db/auth listening: $(sockstat -l | grep -c -E ':(15000|11000) ') (expect 2)"