mirror of
https://github.com/GameServerManagers/LinuxGSM.git
synced 2026-04-24 21:56:01 +03:00
[GH-ISSUE #1179] Change variables to be overwritten by environment variables #923
Labels
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/LinuxGSM#923
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Herover on GitHub (Nov 7, 2016).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/1179
Instead of setting variables using
foo = "bar"style, a alternative could be to usefoo = "${foo:-"bar"}"since it would allow defining variables beforehand.This is very useful if you want to use scripts from here in Docker since it's often best to only change application data (game folders, logs etc.) and not binaries/scripts.
It would not be required change the variables in the function scripts. There could be potential problems regarding existing variables on the system, but I have not found any on a new Ubuntu 16.04 (using
printenv). Another problem I see is integrating it with all the branches and other ongoing development without breaking stuff.Thoughts?
@UltimateByte commented on GitHub (Nov 7, 2016):
Well, if this allows people to use dockers (and there have been some) it's something to maybe consider. LGSM has not been considering dockers for now. I personally still don't know much about dockers so... a "why would it fix it" explanation would be welcome.
However the major downside i see to it is that it would look way less pretty and way less easy to edit for users. Maybe, it's something that could be done to the main script after we moved configs to external files ? (yes, this is a project, sorry for spoiler :p)
@Herover commented on GitHub (Nov 8, 2016):
The "why" would be that users could run something like
docker run -it -p 1.2.3.4:27015:27015 -e "port=27015" -e ="ip=1.2.3.4" lgsm-css:latest startto create a new server in very few seconds instead of full installs for every server, and all the dependencies and setup would already be done in the docker image that can be reused by multiple docker containers (by default, docker transparently uses files from a image unless it has been changed in the container). It's also possible to "mount" a directory making stuff like maps shared among multiple servers easy.For testing I've build a Dockerfile and edited the script for garrys mod. Turns out docker only runs untill whatever used in the
docker runcommand runs, meaning using tmux is not possible (or needed) and it's currently only possible to run the server in debug mode. I imagine a special command that starts a server without using tmux would fix this. I'm also unsure if srcds is able to bind to IP addresses, I had to remove the-ippart of the parameters for it to be able to run.Looking at it again from a docker perspective, it seems to require a good amount of work, but it could be worth it imo :)
@UltimateByte commented on GitHub (Nov 8, 2016):
srcds can usually bind to IPv4s with no issue, unless there is some weird stuff happening to the IP routing when using dockers or something.
Are dockers already kind of working like tmux does ? And is there some kind of environment variable to detect wether or not it's being started from a docker ?
It seems manageable to make special config files for dockers and some conditional checks (or a config setting... and loads of rework) to not use tmux, but would be much easier once config files have moved from main scripts. Would be preferable that somebody who actually uses dockers do it i guess. On the other hand, having two sets of config files for all servers would be a pain to maintain. From what i understand for the few years of LGSM usage and support and more recently, dev, is that the philosophy is 1) easy for users 2) as universal as possible 3) maintainable for devs. Keep that in mind. ^^
@togenshi commented on GitHub (Nov 10, 2016):
As someone that is running the servers on a 864 person lan using lgsm, docker is not a solution catered for game servers with mods at this moment. You are better off using lxc/lxd with overlayfs, or vmware with linked clones (current solution - could use hyper-v for free though). Mainly since game servers were more developed with a "pet ideology" than cattle since they are usually left running. Also much easier to assign CPU groups.