GameServerManagers / LinuxGSM

The command-line tool for quick, simple deployment and management of Linux dedicated game servers.
https://linuxgsm.com
MIT License
4.25k stars 813 forks source link

[Bug]: check_permissions enforces ownership of folders #4323

Open timvahlbrock opened 11 months ago

timvahlbrock commented 11 months ago

User story

As a user, I might not want to make the LGSM user owner of the LGSM_SERVERFILES directory, but only give it sufficient permissions using group

Game

Garrys Mod

Linux distro

Ubuntu 22.04, Ubuntu 20.04, Ubuntu 18.04, Ubuntu 16.04, Debian 12, Debian 11, Debian 10, Debian 9, RedHat 9, RedHat 8, RedHat 7

Command

command: update, command: install

Further information

I'm running a container that uses lgsm within a docker cluster. The server files directory is mounted as a volume to decrease server reboot time. Local-Path docker volumes currently don't support (automatically) setting the owner of the volume mount directory, but only setting the group. However, check_permissions still requires, that the owner of the server files directory is the active user. Currently I can work around this by nesting the server files directory in another directory. As lgsm will create this directory on demand, it will also be the owner of it.

Relevant log output

[ FAIL ] Updating LinuxGSM gmodserver: Ownership issues found
Information! The current user (steam) does not have ownership of the following files:
tee: /home/steam/log/script/gmodserver-script.log: No such file or directory
User Group File
root steam /home/steam/serverfiles
Information! please see https://docs.linuxgsm.com/support/faq#fail-starting-game-server-permission-issues-found

Steps to reproduce

  1. create a directory, where the owner is another user, e.g. root
  2. allow the current user (e.g. steam) to use the directory by adding setting their group
  3. set LGSM_SERVERFILES to the path of the directory
  4. try to run lgsm install or update
dgibbs64 commented 6 months ago

There are now official LinuxGSM docker images available. I am unsure if this helps with this specific issue. I personally am not running into on my containers but if it is still an issue please let me know.