Skip to content

armgit / soju

Public Imported from GitHub
0

Play Windows games on Apple Silicon Macs. Free, open-source app that installs the official Battle.net, Steam, Epic and GOG launchers and lists your games in one library.

reaper: compare the wineserver cwd against the resolved /private/tmp path too

mikey9217257c512583
diff --git a/docs/DIAGNOSIS.md b/docs/DIAGNOSIS.md
index c69349beebf..5077cc29cf8 100644
--- a/docs/DIAGNOSIS.md
+++ b/docs/DIAGNOSIS.md
@@ -258,6 +258,17 @@ UI 스레드(TID 36)의 마지막 기록이 11:12:04이고 그 뒤로 전무한
실제로 고아 상태였던 GOG(1일 14시간 경과)에 새 리퍼를 붙이자 40초 뒤 다섯 개 프로세스를 모두
정리하고 종료했다.
+### 후속 (2026-09-02): 살아 있는 서버도 "없음"으로 판정하던 버그
+
+Epic 런처가 시작 40초 뒤마다 죽었다. 런처 로그는 정상 상태에서 끊기고 크래시 흔적이 없었다.
+원인은 위 생존 확인: macOS에서 `/tmp`는 `/private/tmp`로 가는 심볼릭 링크라 `lsof`는 cwd를
+`/private/tmp/.wine-501/server-…`로 보고하는데, 비교 대상은 `stat`로 만든 `/tmp/…` 문자열이었다.
+한 번도 일치하지 않으니 매 주기 고아 판정이 쌓여 두 번째 주기에 런처를 죽였다. 위의 GOG 검증은
+정말 서버가 없던 경우라 이 오판이 드러나지 않았다.
+
+`cd /tmp && pwd -P`로 해석한 경로도 함께 받아들이도록 고쳤다. 고친 뒤 Epic 런처를 앱 번들로
+띄우고 2분 뒤 확인: 런처·리퍼·wineserver 모두 생존.
+
## Epic 로그인 `too_many_sessions`: ncrypt에 영구 키가 없어서 매번 새 기기가 된다 (2026-08-31)
### 증상
diff --git a/scripts/soju-reaper.sh b/scripts/soju-reaper.sh
index e502fac62f4..8cffda7adab 100755
--- a/scripts/soju-reaper.sh
+++ b/scripts/soju-reaper.sh
@@ -54,14 +54,19 @@ esac
# one) blocks forever, so its window stops repainting and stops responding while
# the process still looks alive. Nothing can rescue it at that point, and the
# leftovers have to be killed for the next start to work.
+# lsof reports the resolved path, and on macOS /tmp is a symlink to
+# /private/tmp, so compare against the resolved form as well: with only the
+# /tmp spelling the check never matched, and the reaper killed every launcher
+# 40 s after it started.
SERVER_DIR="$(/usr/bin/stat -f "/tmp/.wine-$(id -u)/server-%Xd-%Xi" "$PREFIX" 2>/dev/null || true)"
+SERVER_DIR_REAL="$(cd /tmp 2>/dev/null && pwd -P)${SERVER_DIR#/tmp}"
server_alive() {
local pids
[ -n "$SERVER_DIR" ] || return 0 # cannot tell, assume it is there
pids=$(pgrep -x wineserver 2>/dev/null | tr '\n' ',' | sed 's/,$//')
[ -n "$pids" ] || return 1
- lsof -a -p "$pids" -d cwd -Fn 2>/dev/null | grep -qx "n$SERVER_DIR"
+ lsof -a -p "$pids" -d cwd -Fn 2>/dev/null | grep -qxF -e "n$SERVER_DIR" -e "n$SERVER_DIR_REAL"
}
reap_orphans() {