Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command gameserver log #3244

Open
AlexCloudDev opened this issue Feb 13, 2021 · 4 comments
Open

New command gameserver log #3244

AlexCloudDev opened this issue Feb 13, 2021 · 4 comments
Labels

Comments

@AlexCloudDev
Copy link

AlexCloudDev commented Feb 13, 2021

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

@AlexCloudDev AlexCloudDev added the type: feature request New feature or request label Feb 13, 2021
@dgibbs64
Copy link
Member

dgibbs64 commented 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

@AlexCloudDev
Copy link
Author

AlexCloudDev commented 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

@dgibbs64
Copy link
Member

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 :)

@AlexCloudDev
Copy link
Author

AlexCloudDev commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants