[GH-ISSUE #3244] New command gameserver log #2252

Open
opened 2026-02-27 03:01:45 +03:00 by kerem · 4 comments
Owner

Originally created by @AlexCloudDev on GitHub (Feb 13, 2021).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/3244

User Story

As a volunteer trying to help and improve the Docker container implementation, I want a new command like gameserver log to output the gameserver log into stdout like gameserver debug does.

Basic info

  • Distro: general
  • Game: general
  • Command: log
  • LinuxGSM version: [v20.1.3]

Further Information

I use a run.sh as entrypoint and therefore i need a proper PID 1 process for the container.
Due to the fact, that gameserver start spawns the server as new process, it can't be used.
Therefor it would be perfect, if some gameserver log command would exist, that outputs continuously the gameserver logs into stdout like gameserver debug does and runs as long as the gameserver.

Then, the run.sh called as entrypoint could look like this:
#!/bin/bash
....
su -c "gameserver start" $user
su -c "gameserver log" $user <------ running as long as the gameserver runs

With this approach, the docker logs command would flawlessly provide all the logging from the gameserver and the container would be stopped if the gameserver is.
And maybe a gameserver log command could provide handy information in other use cases than in a container environment.

Cheers

Originally created by @AlexCloudDev on GitHub (Feb 13, 2021). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/3244 ## User Story As a volunteer trying to help and improve the Docker container implementation, I want a new command like **gameserver log** to output the gameserver log into stdout like **gameserver debug** does. ## Basic info * **Distro:** general * **Game:** general * **Command:** log * **LinuxGSM version:** [v20.1.3] ## Further Information I use a run.sh as entrypoint and therefore i need a proper PID 1 process for the container. Due to the fact, that _gameserver start_ spawns the server as new process, it can't be used. Therefor it would be perfect, if some **gameserver log** command would exist, that outputs continuously the gameserver logs into stdout like _gameserver debug_ does and runs as long as the gameserver. Then, the run.sh called as entrypoint could look like this: `#!/bin/bash` `....` `su -c "gameserver start" $user` `su -c "gameserver log" $user` <------ running as long as the gameserver runs With this approach, the _docker logs_ command would flawlessly provide all the logging from the gameserver and the container would be stopped if the gameserver is. And maybe a **gameserver log** command could provide handy information in other use cases than in a container environment. Cheers
Author
Owner

@dgibbs64 commented on GitHub (Feb 13, 2021):

so my thought would be something as simple as tail -f on the console log

Alternatively, we could create a new command like ./gameserver debug something like ./gameserver start-docker that doesn't use tmux and outputs directly to the terminal

<!-- gh-comment-id:778690032 --> @dgibbs64 commented on GitHub (Feb 13, 2021): so my thought would be something as simple as `tail -f` on the console log Alternatively, we could create a new command like `./gameserver debug` something like `./gameserver start-docker` that doesn't use tmux and outputs directly to the terminal
Author
Owner

@AlexCloudDev commented on GitHub (Feb 18, 2021):

Hello,
yes, sounds good for me.
We just need a command that runs as long as the gameserver does and outputs log info.
I tried it with ./gameserver debug, but that doesn't fit well, it also requieres an input at the beginning (Y or N)
So something like ./gameserver start-docker would be superb

<!-- gh-comment-id:781315456 --> @AlexCloudDev commented on GitHub (Feb 18, 2021): Hello, yes, sounds good for me. We just need a command that runs as long as the gameserver does and outputs log info. I tried it with ./gameserver debug, but that doesn't fit well, it also requieres an input at the beginning (Y or N) So something like ./gameserver start-docker would be superb
Author
Owner

@dgibbs64 commented on GitHub (Feb 18, 2021):

Since there is a renewed interest in the docker container I will be spending some time on trying to get it to a production state that can be supported. I am going to need some support from docker experts :)

<!-- gh-comment-id:781330612 --> @dgibbs64 commented on GitHub (Feb 18, 2021): Since there is a renewed interest in the docker container I will be spending some time on trying to get it to a production state that can be supported. I am going to need some support from docker experts :)
Author
Owner

@AlexCloudDev commented on GitHub (Feb 19, 2021):

I'm far from being a docker expert, but i would like to help.
My approach so far is to let the user chose which gameserver he wants by setting a build argument at the docker-compose.yml.
Then, the image is build with this specific gameserver and at the end a run.sh script is called as entrypoint.
This script starts the gameserver and then calls tail --pid=pidof tmux -f /dev/null to keep the PID 1 alive as long as the gameserver runs, in absence of a proper command like ./gameserver log/start-docker etc.

For a public distribution of the images over hub.docker, we could use different tags for different games:
gameservermanagers/linuxgsm-docker:valheim
gameservermanagers/linuxgsm-docker:rust
etc

Another approach would be to build a uniform, unspecific image just with the linuxGSM script in the first place and install the gameserver files later via ENV at run.sh runtime.
I think, this question is a matter of personal flavor, but in the case, you're running multiple instances of the same game, you have to download the game files over and over again. Or if you destroy the container, you have also to re-download everything.

Also i made the whole dir where all files are downloaded a volume/host share, to give the gameserver's world/savegames and settings persistence.
I considered setting those server values like world name etc with ENVs, but due to the fact, that all the different games have own key words, i did not.

How can i help?

<!-- gh-comment-id:782169242 --> @AlexCloudDev commented on GitHub (Feb 19, 2021): I'm far from being a docker expert, but i would like to help. My approach so far is to let the user chose which gameserver he wants by setting a build argument at the docker-compose.yml. Then, the image is build with this specific gameserver and at the end a run.sh script is called as entrypoint. This script starts the gameserver and then calls _`tail --pid=`pidof tmux` -f /dev/null`_ to keep the PID 1 alive as long as the gameserver runs, in absence of a proper command like ./gameserver log/start-docker etc. For a public distribution of the images over hub.docker, we could use different tags for different games: gameservermanagers/linuxgsm-docker:valheim gameservermanagers/linuxgsm-docker:rust etc Another approach would be to build a uniform, unspecific image just with the linuxGSM script in the first place and install the gameserver files later via ENV at run.sh runtime. I think, this question is a matter of personal flavor, but in the case, you're running multiple instances of the same game, you have to download the game files over and over again. Or if you destroy the container, you have also to re-download everything. Also i made the whole dir where all files are downloaded a volume/host share, to give the gameserver's world/savegames and settings persistence. I considered setting those server values like world name etc with ENVs, but due to the fact, that all the different games have own key words, i did not. How can i help?
Sign in to join this conversation.
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
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LinuxGSM#2252
No description provided.