First linux install test #45

Closed
opened 2026-11-22 02:18:05 -06:00 by whitlocktech · 0 comments
Owner

Linux install: permissions, false success, doctor bind, and handoff URL

Found on: installer v0.8.1, bundle 2026.09.15 (servuo-plugins v1.3.0, uo-link v2.3.0), Ubuntu 24.04, ServUO 57.4 under Mono 6.8. This was the first Linux deployment; until now only Windows had been deployed.

Result: after a manual fix to permissions and to the web bind, the install works end to end. doctor is clean, [Bridge] enabled=True appears at boot, the shard is connected, and the website on another host is linked. Everything below happened along the way.


1. File modes and owners come from root's umask

What happened: the installer was run with umask 077, which is unusual, but CIS-hardened hosts default to 027. It created these as root:root 0700:

  • /etc/runicgateway/
  • <ServUO>/Scripts/Custom/
  • <ServUO>/Scripts/Custom/Bridge/ (and the 38 .cs files were root-owned)

sidecar.toml itself was chowned to runicgateway. Its parent directory was still root-only, though, so the sidecar couldn't reach it.

Effect:

  • The sidecar crash-looped with Error: Permission denied (os error 13).
  • ServUO, running as servuo, couldn't read the overlay. See #2.

Under umask 027 the result would be 0750 root:root, which fails the same way.

Fix:

  • Set modes and owners explicitly instead of inheriting the umask.
  • /etc/runicgateway: 0755, or 0750 root:runicgateway.
  • Overlay files and directories: owned by whoever owns the ServUO root (stat the root and copy its uid/gid), with 0644 files and 0755 directories.
  • Windows doesn't hit this because ACLs are inherited, which is probably why it hasn't come up before.

2. Install and doctor report success while things are broken

What happened:

  • Install summary: it printed service runicgateway-link.service activating, enabled and Runic Gateway is installed. while the service was crash-looping (restart counter at 17 within a minute).
  • ServUO build: with the overlay unreadable, it printed Build succeeded. 0 Error(s) and simply didn't compile the Bridge. The installer output does warn that a clean boot isn't proof, so that part is known.
  • doctor: it reported ✓ Overlay in sync — all hashes match because it hashes the files as root. It never notices that the ServUO run-as user can't read them.

Fix:

  • install: after starting the service, poll /health for a few seconds. If it isn't ok, fail or warn loudly and show the last journal lines.
  • doctor: check readability as the actual run-as users.
    • Overlay: readable by the owner of the ServUO root, or by the user from the shard's systemd unit if one is found.
    • Config: sidecar.toml and every directory on its path traversable and readable by runicgateway.
    • Database: uo-link.db directory writable by runicgateway.

3. doctor always probes 127.0.0.1:8080

What happened: with [web] bind = "192.168.1.154:8080", doctor reported ✗ Sidecar reachable — nothing answered http://127.0.0.1:8080/health and Shard connected — unknown. The sidecar was healthy and the remote website could reach it.

Fix: read [web].bind from sidecar.toml, honouring UOLINK_WEB_BIND if the unit sets it.

  • If the bind is 0.0.0.0 or ::, probe loopback.
  • Otherwise probe the bound address.

4. The handoff URL doesn't match the default web bind

What happened: the default is [web] bind = "127.0.0.1:8080", which is loopback only. The handoff then prints:

Base URL          http://servuo:8080
WebSocket URL     ws://servuo:8080/ws

A website on another host, which is probably the common case, can never connect with those defaults. A website running in Docker also may not resolve the bare hostname servuo.

Note: the [shard] bind = 127.0.0.1:7788 loopback is deliberate (the shard↔sidecar IPC) and should stay that way. This item is only about [web].

Fix (any of these):

  • Add --web-bind <ADDR:PORT> for --game servuo, like Rust's --web-port, or prompt for it: "Will the website run on this host?"
  • When the bind is loopback, say so in the handoff. For example: "The website must run on this host, or behind a reverse proxy here. To reach it from another machine, set [web] bind and restart the service."
  • Print the URL with the bound IP, or the host's primary IP when the bind is 0.0.0.0, rather than the hostname. --host still overrides it.

5. Smaller items

  • Sidecar error has no path: Permission denied (os error 13) should name the file or directory it failed on.
  • Wrong pid in the running-shard refusal: it named pid 33779, but the ServUO process was 33738. On the first run it showed 33738 correctly. It looks like it sometimes picks up a thread ID (TID) from the /proc scan rather than the process ID (TGID). Harmless, but confusing when you go to kill it.
  • Token printed to stdout: under automation (Semaphore, Ansible, CI) the token ends up in task logs. Consider a --no-print-token flag, or print token: (in /etc/runicgateway/sidecar.toml) when stdout isn't a TTY.

What worked well

SHA256 verification of every download; the --verify dry run; ServUO 57.4 detection; the refusal to run against a live shard, which caught a stray ServUO process sharing the save directory; backups before overwrite; the libgdiplus check; and the Mono compile of the overlay once it was readable.

# Linux install: permissions, false success, doctor bind, and handoff URL **Found on:** installer v0.8.1, bundle 2026.09.15 (servuo-plugins v1.3.0, uo-link v2.3.0), Ubuntu 24.04, ServUO 57.4 under Mono 6.8. This was the first Linux deployment; until now only Windows had been deployed. **Result:** after a manual fix to permissions and to the web bind, the install works end to end. `doctor` is clean, `[Bridge] enabled=True` appears at boot, the shard is connected, and the website on another host is linked. Everything below happened along the way. --- ## 1. File modes and owners come from root's umask **What happened:** the installer was run with `umask 077`, which is unusual, but CIS-hardened hosts default to `027`. It created these as `root:root 0700`: - `/etc/runicgateway/` - `<ServUO>/Scripts/Custom/` - `<ServUO>/Scripts/Custom/Bridge/` (and the 38 `.cs` files were root-owned) `sidecar.toml` itself was `chown`ed to `runicgateway`. Its parent directory was still root-only, though, so the sidecar couldn't reach it. **Effect:** - The sidecar crash-looped with `Error: Permission denied (os error 13)`. - ServUO, running as `servuo`, couldn't read the overlay. See #2. Under `umask 027` the result would be `0750 root:root`, which fails the same way. **Fix:** - Set modes and owners explicitly instead of inheriting the umask. - `/etc/runicgateway`: `0755`, or `0750 root:runicgateway`. - Overlay files and directories: owned by whoever owns the ServUO root (`stat` the root and copy its uid/gid), with `0644` files and `0755` directories. - Windows doesn't hit this because ACLs are inherited, which is probably why it hasn't come up before. ## 2. Install and doctor report success while things are broken **What happened:** - **Install summary:** it printed `service runicgateway-link.service activating, enabled` and `Runic Gateway is installed.` while the service was crash-looping (restart counter at 17 within a minute). - **ServUO build:** with the overlay unreadable, it printed `Build succeeded. 0 Error(s)` and simply didn't compile the Bridge. The installer output does warn that a clean boot isn't proof, so that part is known. - **doctor:** it reported `✓ Overlay in sync — all hashes match` because it hashes the files as root. It never notices that the ServUO run-as user can't read them. **Fix:** - **install:** after starting the service, poll `/health` for a few seconds. If it isn't `ok`, fail or warn loudly and show the last journal lines. - **doctor:** check readability as the actual run-as users. - **Overlay:** readable by the owner of the ServUO root, or by the user from the shard's systemd unit if one is found. - **Config:** `sidecar.toml` and every directory on its path traversable and readable by `runicgateway`. - **Database:** `uo-link.db` directory writable by `runicgateway`. ## 3. doctor always probes `127.0.0.1:8080` **What happened:** with `[web] bind = "192.168.1.154:8080"`, doctor reported `✗ Sidecar reachable — nothing answered http://127.0.0.1:8080/health` and `Shard connected — unknown`. The sidecar was healthy and the remote website could reach it. **Fix:** read `[web].bind` from `sidecar.toml`, honouring `UOLINK_WEB_BIND` if the unit sets it. - If the bind is `0.0.0.0` or `::`, probe loopback. - Otherwise probe the bound address. ## 4. The handoff URL doesn't match the default web bind **What happened:** the default is `[web] bind = "127.0.0.1:8080"`, which is loopback only. The handoff then prints: ``` Base URL http://servuo:8080 WebSocket URL ws://servuo:8080/ws ``` A website on another host, which is probably the common case, can never connect with those defaults. A website running in Docker also may not resolve the bare hostname `servuo`. **Note:** the `[shard] bind = 127.0.0.1:7788` loopback is deliberate (the shard↔sidecar IPC) and should stay that way. This item is only about `[web]`. **Fix (any of these):** - Add `--web-bind <ADDR:PORT>` for `--game servuo`, like Rust's `--web-port`, or prompt for it: "Will the website run on this host?" - When the bind is loopback, say so in the handoff. For example: "The website must run on this host, or behind a reverse proxy here. To reach it from another machine, set `[web] bind` and restart the service." - Print the URL with the bound IP, or the host's primary IP when the bind is `0.0.0.0`, rather than the hostname. `--host` still overrides it. ## 5. Smaller items - **Sidecar error has no path:** `Permission denied (os error 13)` should name the file or directory it failed on. - **Wrong pid in the running-shard refusal:** it named `pid 33779`, but the ServUO process was `33738`. On the first run it showed 33738 correctly. It looks like it sometimes picks up a thread ID (TID) from the `/proc` scan rather than the process ID (TGID). Harmless, but confusing when you go to `kill` it. - **Token printed to stdout:** under automation (Semaphore, Ansible, CI) the token ends up in task logs. Consider a `--no-print-token` flag, or print `token: (in /etc/runicgateway/sidecar.toml)` when stdout isn't a TTY. ## What worked well SHA256 verification of every download; the `--verify` dry run; ServUO 57.4 detection; the refusal to run against a live shard, which caught a stray ServUO process sharing the save directory; backups before overwrite; the `libgdiplus` check; and the Mono compile of the overlay once it was readable.
whitlocktech added the
bug
label 2026-11-22 02:18:05 -06:00
Sign in to join this conversation.
No description provided.