Running-shard detection false-negative: shard launched 'mono ServUO.exe' from the server dir is seen as 'not running' #47
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
Running-shard detection is a false negative when the shard is launched
mono ServUO.exefrom the server directorySeverity: high — it defeats the install/update safety check that is explicitly "not overridable" because deploying under a live shard corrupts
Scripts.dlland/orSaves/.Found on: installer v0.8.1 (released Linux x86_64 binary), bundle 2026.11.26.2 (servuo-plugins v1.3.3, uo-link v2.3.0), Mono 6.8 on WSL2 Ubuntu. Code path unchanged on
main:src/servuo.rs::find_running(line ~218).Summary
find_runningdecides a process is the shard only if its executable path + command-line arguments, normalized, contain both the ServUO root path and the stringservuo.exe. On Linux the shard's working directory is never consulted. When a shard is started the normal way — from inside the server directory,mono ServUO.exe(relative), which is what a systemd unit withWorkingDirectory=<root>/ExecStart=mono ServUO.exeproduces — the root path appears only in the process's cwd, not in its exe or argv. So the match fails,find_runningreturnsNone, andinstall/updateprintShard process not runningand deploy on top of a live shard.This is the same symptom reported separately ("installer said the server was not running when it was"). It is distinct from #45 item 5 (that detection fired but reported a thread id); here detection does not fire at all.
Reproduction (empirical, with the released v0.8.1 binary)
A ServUO-shaped tree (
ServUO.exe+Scripts/+Config/+Server/AssemblyInfo.csreporting 57.4).ServUO.exeis a stand-in assembly that sleeps forever —find_runningonly inspects a process's exe/cmd/cwd, not shard internals, so the detection path is exercised faithfully.install --verifyis used (writes nothing); it resolves the root through the sameopen_stopped/find_runningasupdate.Case A — operator-style launch (FAILS)
Case B — absolute-path launch (works, control)
Case C — genuinely stopped (works, control)
Shard process not running, proceeds. Correct.Detection is therefore launch-shape dependent: the same running shard is caught or missed depending only on whether the full path happens to be in argv. The dangerous shape (relative launch from the root) is the common one for a service-managed shard.
Root cause
src/servuo.rs, infind_running:hayis built fromexe+cmdonly. The process working directory — where the root path lives for a relative launch — is never read.sysinfo::Processexposes.cwd().Suggested fix
Treat "this process belongs to
root" as satisfied by either the path appearing in exe/argv or the process's cwd beingroot(or a subdirectory of it), still combined with the existingservuo.exerequirement so it does not over-match:Over-match risk stays low: a process whose cwd is the ServUO root and whose command line names
servuo.exeis the shard (the installer already skips its own pid). A regression test in the same style as the existingnothing_is_running_out_of_an_empty_tree— a stand-in launched relative from the root must be found — would lock this in.Side note (corroborates #45 item 5)
In Case B the refusal reported a pid one or two higher than the real process pid (
pgrepPID vs the printed pid) — the/procscan is enumerating threads (TIDs) alongside the main thread (TGID). Samefind_running/sysinfo scan; worth fixing together.Filed from automated testing by Claude Code (Opus 4.8). Reproduction scripts available on request.