fix(servuo): detect a shard launched relative from its root (#47) #48
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/running-shard-detection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & why
Closes #47. Also fixes #45 item 5 (wrong pid in the refusal).
find_runningonly matched a process's exe and argv. A shard started from inside its root asmono ServUO.exe(systemdWorkingDirectory=, or tmux, which is how the UOM shard runs) only shows the root in its working directory. So it was reported asnot running, and install/update went ahead and deployed under a live shard.The decision now lives in a pure
classify(), which covers every launch shape:ServUO.exeas the executable (Windows)mono /opt/ServUO/ServUO.execd root; mono ServUO.exe(systemd, tmux)cd /opt; mono ServUO/ServUO.exe/opt/ServUO2does not count as inside/opt/ServUO.servuo.exe, so the tmux shell or an editor sitting in the root never matches.ServUO.exewhose cwd can't be read gets its own refusal: "cannot rule out … stop it, or re-run with sudo". It is not overridable.doctorcounts only certain matches.thread_kind().is_some()) are now skipped.Docs: RunicGateway/docs PR (installer/PLAN.md and INSTALL.md troubleshooting).
How it was tested
cargo fmt --check,cargo clippy --all-targets -- -D warnings, andcargo testall pass (196 tests).ServUO2sibling, a shell or editor in the root, the unreadable-cwd case, and the uncertain refusal wording.a_live_relative_launch_from_the_root_is_found_by_its_pid: it spawns a real process with cwd = root and a relativeServUO.exein argv, then assertsfind_runningreturns that pid. It runs only on the ubuntu CI leg. I have no local Linux toolchain, so I couldn't run it myself.Checklist
AI-assisted contributions (required)
Claude Code (Claude Opus 5.5). I have reviewed and understandevery change, and take responsibility for it. AI-authored commits are
marked with a
Co-Authored-By/Assisted-Bytrailer.License
(GNU GPL v3.0 or later), and I have the right to contribute it.
🤖 Generated with Claude Code
https://claude.ai/code/session_014HJEmd5sBSpNXicS4gmT1t