Permissions
I am perhaps trying to do something the script is not capable of :- on reflection of the fastdl module I setup a standard apache install on Ubuntu added a folder to var/www/html via a user other than the default www-data and installed the game server there ... so the path is /var/www/html/gmod and the user is gamer with a group of gamer all works ok until you actually try to run the script as www-data (apache user) ... the script returns
`Current script owner: gamer current user is www-data we are going to do st Please Wait starting server [K[[0;31m FAIL [0m] Starting gmod-server: Oops ! Ownership issue...
- Current - www-data - user or its group(s) - www-data gamer hv test - does not own "gmodserver"
- To check the owner and allowed groups, run ls -l "gmodserver"`
as you can see the script indicates an ownership issue even though the executing user belongs to the script owner group (in this case user 'www-data' is in the group 'gamer') should this user be able to run the script as the user belongs to a valid group or does the script only run as the respective user and the error message should not show or imply that only a group is required to run the script ?
For now, the script wants the user to be the owner as this is how the script is intended to be used in the first place. Maybe that rule should be more relaxed for more fancy uses. :o))
I need to review this code as teh function doesnt fully comply with how I want the permissions checker to be. @UltimateByte dont worry its a decent function. Im just very fussy.
@dgibbs64 I don't feel offended, it for sure can be improved. ^^
The way I handle this on my managed servers is as such:
- Create a shared FastDL location for my game servers, like /opt/fastdl
- Set the permissions via ACL so that game server manager can write
- Run sync script to move non-standard maps to this location, and symlink each file back to ~/serverfiles/$GAME/maps/
- Have an Apache conf.d snippet that creates an alias and sets permissions for users to read and download those files, with indexes.
This way I don't have to do any weird things like give gameserver users www-data group access, or deal with duplicate files. I also don't need to give www-data any permissions to my game server users' files, which is my biggest concern. The primary use of these servers is games, so I worry more about a compromised Apache screwing up game servers than game servers screwing up Apache.
The issue here was the script indicated that the user group should be valid to run the script but it does not .. I am pointing out most game server installers don't want to mess about :- install & work thats all they want ...
The function is here https://github.com/dgibbs64/linuxgsm/blob/master/lgsm/functions/check_permissions.sh Feel free to pull request something that would solve your issue and keep it working in the current LGSM :)
I have a similar problem and now can't start my server. I run a web control panel on my box and it auto adds the folders 'conf' and 'mail' to the home dir of every user it creates. These folders have root ownership which I can't change and therefore the server fails to start.
Is there a way we can add files and folders to be excluded from the permissions check?
I will take a look at this for you
@twinsuns please create a new issue as this is not related to your problem also update your functions. I have just make a change that should resolve your issue
This should be solved now, as there is now a selective permission check. Re-open if needed, but i don't think so. :)
Hello, where I can select to disable checking ownership?
@hitmany What for ?
@UltimateByte Its frustrating me))) srly, I have a lot of servers in 1 dedic server(each game server using different user) and when I uploading new files to game server directory I cant start/stop/watch console - all commands throws ownership error Hate it)
@hitmany this is not a valid reason, learn how to manage your files properly
https://github.com/GameServerManagers/LinuxGSM/wiki/File-Ownership https://github.com/GameServerManagers/LinuxGSM/wiki/FTP-SCP
Don't use ftp, use sftp, and more than anything else, use it as the user you're working on not as root, ever. Don't do that ever again. If you need to edit root files use ssh as anyone rational. That said, use ssh to edit files rather than an sftp, use sftp only to upload files.
@UltimateByte I am using SFTP only, but for each server I must use different users For example: I have 5 servers on LGSM, each server has own user(user1,user2,user3,user4) I must update servers extension in one time, what I must do to prevent your ownership errors:
- login as user1 and upload extensions to server1
- reconnect WinSCP and login as user2 and upload extensions to server2 ))))
I use filezilla and save users credentials, problem solved. Filezilla supports sftp. Otherwise it try to download and edit from the user directly with su - user then nano, wget, unzip, cp, mv... Problem solved again.
@UltimateByte okay if you wont to add this feature its not problem
I totally understand I have 5 servers on LGSM, each server has own user(user1,user2,user3,user4) I must update servers extension in one time, what I must do to prevent your ownership errors:
- login as user1 and upload extensions to server1
- reconnect WinSCP and login as user2 and upload extensions to server2 I really don't see why this is not possible
Guys I am not forcing you to do a new feature if its difficult to add a few lines of code Thank you for great LGSM
I have nothing to do with the project .. I just interjected that your issue is valid and should be addressed