Skip to content

fix(ut99): keep config and logs in serverfiles with -nohomedir - #5133

Open
dgibbs64 wants to merge 1 commit into
developfrom
fix/ut99-user-dir
Open

dgibbs64 wants to merge 1 commit into
developfrom
fix/ut99-user-dir

Conversation

@dgibbs64

@dgibbs64 dgibbs64 commented Nov 1, 2026

Copy link
Copy Markdown
Member

Description

The OldUnreal 469 patch uses ~/.utpg as a per-user directory on Linux. Unless the server is started with -nohomedir (found in Core.so, along with SETHOMEDIR=), every ini the engine creates or saves goes to ~/.utpg/System, not serverfiles/System. This is why mutators that write their own ini (ACE, map vote, NewNet and so on) seem to write nothing: the file is created, but in ~/.utpg/System, where nobody looks. 469 also looks for inis in the home directory before System, so a copy there silently overrides the one admins edit.

The same directory also explains the large ~/.utpg seen on servers. ucc.log and the per-match ngLog stats files go to ~/.utpg/Logs and ~/.utpg/NetGamesUSA.com, while LinuxGSM's game log dir (serverfiles/Logs) stays empty and log rotation never touches them. On one long-running server this was about 544 MB (272 MB of ngLogs in each folder, 271 files), plus a User.ini the server had written there.

Changes:

  • ut99server/_default.cfg: add -nohomedir to startparameters, as ut2k4 and ut3 already do.
  • New pre-start fix_ut99.sh: when startparameters has -nohomedir, it moves any *.ini left in ~/.utpg/System into ${systemdir}, so existing servers keep their mutator settings and User.ini. The home copy was the one the server actually read, so it wins. A file it replaces in System (for example the stock User.ini) is kept as a numbered backup (User.ini.~1~). Once the files are moved, the fix does nothing on later starts.
  • Registered in core_modules.sh and fix.sh.

Old logs in ~/.utpg/Logs and ~/.utpg/NetGamesUSA.com are not moved. Admins can delete ~/.utpg once the server has started on this version.

Backups (#5129): after this change UT99 keeps its config under serverfiles, which backup already covers, so no fn_backup_extradirs entry is needed.

Fixes #3835

Affected servers: ut99

Type of change

  • Bug fix (a change which fixes an issue).
  • New feature (a change which adds functionality).
  • New Server (new server added).
  • Refactor (restructures existing code).
  • Chore (CI, workflows, tooling or other maintenance).
  • Comment update (typo, spelling, explanation, examples, etc).

Testing

  • Commands/tests run:
    • Fresh gameservermanagers/gameserver:ut99 container (469f RC6) on a test server, current develop. After start, ~/.utpg/System held ucc.log and ~/.utpg/Logs held the ngLog, while serverfiles/Logs was empty.
    • Started ucc-bin server with an ini= and userini= that did not exist yet. Without -nohomedir both files were created in ~/.utpg/System. With -nohomedir both were created in serverfiles/System. An strace of a normal start showed User.ini looked up in ~/.utpg/System first, then System.
    • Seeded ~/.utpg/System with a mutator-style ACE4835.ini and a modified User.ini, as an existing server would have. Then swapped in this branch's modules and _default.cfg, and ran start.
    • restart, then a direct gamedig query on the container IP, then monitor.
  • Result:
    • start printed Applying move ACE4835.ini ... and Applying move User.ini .... Both files are now in serverfiles/System with their settings, and the stock User.ini was kept as User.ini.~1~ (md5 unchanged).
    • The server runs as ucc-bin server DM-Deck16][.unr ini=.../ut99server.ini -nohomedir. ucc.log is now in serverfiles/System, and new ngLogs go to serverfiles/Logs and serverfiles/NetGamesUSA.com.
    • restart applied no further moves. The query answered (LinuxGSM, DM-Deck16][, 0/10). monitor did not restart the server (start time unchanged).
    • ucc make could not be used to build a real test mutator: in 469f RC6 on Linux it recurses into ./ until the stack overflows. That is an engine bug, unrelated to this change. The ini=/userini= test exercises the same "create a new ini" path that mutators use.
  • Environment used (distro/version): Ubuntu 26.04 (gameserver:ut99 image), OldUnreal UT 469f RC6.

Risk and rollback

  • Risk level: low
  • Rollback plan: revert this PR. Moved inis stay in serverfiles/System. 469 falls back to System when the home directory has no copy, so they keep working without -nohomedir.

Breaking changes

  • No breaking changes.
  • Breaking changes included (describe below).

Note: instances that override startparameters in their own config need to add -nohomedir themselves. Until they do, the fix module leaves ~/.utpg alone.

Documentation

Checklist

PR will not be merged until all steps are complete.

  • This pull request links to an issue ("Fixes", or "Related to" for a partial fix).
  • This pull request uses the develop branch as its base.
  • This pull request subject follows the Conventional Commits standard.
  • This code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have provided a detailed enough description of this PR.

Thank you for your Pull Request!

The OldUnreal 469 patch uses ~/.utpg as a per-user directory on Linux
unless started with -nohomedir. Any ini the engine creates or saves
(mutator configs such as ACE or map vote, User.ini) was written to
~/.utpg/System instead of serverfiles/System, and ucc.log and the
per-match ngLog files went to ~/.utpg, where LinuxGSM never rotated them.

Start UT99 with -nohomedir, as ut2k4 and ut3 already do. A new pre-start
fix_ut99.sh moves any ini left in ~/.utpg/System into the System
directory so existing servers keep their settings. Those files were the
copies the server was reading, since 469 looks in the home directory
first; a stock file they replace is kept as a numbered backup.
@dgibbs64 dgibbs64 added this to the v26.5.0 milestone Nov 1, 2026
@github-actions github-actions Bot added type: bugfix Pull request that fixes a bug engine: unreal Issues related to unreal engine engine: unreal2 Issues related to unreal2 engine engine: unreal3 Issues related to unreal3 engine game: Unreal Tournament 99 Issues related to Unreal Tournament 99 game: Unreal Tournament 2004 Issues related to Unreal Tournament 2004 game: Unreal Tournament 3 Issues related to Unreal Tournament 3 labels Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine: unreal Issues related to unreal engine engine: unreal2 Issues related to unreal2 engine engine: unreal3 Issues related to unreal3 engine game: Unreal Tournament 3 Issues related to Unreal Tournament 3 game: Unreal Tournament 99 Issues related to Unreal Tournament 99 game: Unreal Tournament 2004 Issues related to Unreal Tournament 2004 type: bugfix Pull request that fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant