horizon-server on Linux: say which libraries the game needs, and follow updates
On a Linux without ALSA's library (most minimal server images), the game exits at once with the loader's "error while loading shared libraries: libasound.so.2". The supervisor took that for a crash and restarted it five times over two and a half minutes before giving up with "see logs/latest.log", which holds nothing about it. Now: - `run` starts the game with --help first (it loads no game files) and, if the system can't load it, stops at once with the loader's line and the packages to install on Debian/Ubuntu, Fedora, Arch and NixOS; - `init` prints the same as a warning after "Game:"; - install.sh lists the libraries `ldd` can't find, with the same advice; - docs/server.md says so in the install section. Also, a service installed without the installer's launcher on the PATH ran `<dir>/releases/<tag>/horizon-server`: Linux reports the running program with links resolved, so the unit pinned that release and an update never reached it. The fallback now goes through `<dir>/current` while it points at that release. Found by the end-to-end install check on the ThinkPad (NixOS, no nix-ld libraries) with v2026.10.18.15. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -86,6 +86,18 @@ for tool in horizon-server horizon-prepare; do
|
||||
done
|
||||
|
||||
echo "Installed Horizon $TAG in $RELEASE; horizon-server and horizon-prepare are in $BIN."
|
||||
# The game links ALSA and udev, even as a server; minimal Linux images often lack them.
|
||||
if [ "$(uname -s)" = Linux ] && command -v ldd >/dev/null; then
|
||||
MISSING=$(ldd "$RELEASE/horizon-client" 2>/dev/null | awk '/not found/ { printf "%s ", $1 }')
|
||||
if [ -n "$MISSING" ]; then
|
||||
echo "The game needs libraries this system doesn't have: $MISSING"
|
||||
echo "Install them before starting a server:"
|
||||
echo " Debian, Ubuntu: sudo apt install libasound2 libudev1 (Ubuntu 24.04 and later: libasound2t64)"
|
||||
echo " Fedora, RHEL: sudo dnf install alsa-lib systemd-libs"
|
||||
echo " Arch: sudo pacman -S alsa-lib systemd-libs"
|
||||
echo " NixOS: enable programs.nix-ld with alsa-lib and udev in its libraries"
|
||||
fi
|
||||
fi
|
||||
case ":$PATH:" in
|
||||
*":$BIN:"*) ;;
|
||||
*) echo "Add $BIN to your PATH, for example: echo 'export PATH=\"$BIN:\$PATH\"' >> ~/.profile" ;;
|
||||
|
||||
Reference in New Issue
Block a user