-
-
Notifications
You must be signed in to change notification settings - Fork 840
Description
User story
As a user, i expect every command to work the same in cron.
Game
All
Linux distro
Ubuntu 22.04
Command
command: send
Further information
If you use the ./gameserver send
command via cron, the processes started by cron might never stop, which can put a lot of strain on the host machine.
This only happens when the gameserver is stopped but cron is still executing send commands.
The send
command checks if the game server is stopped and prompts the user to start it. https://github.com/GameServerManagers/LinuxGSM/blob/1522cbd7b3d673aadf5b1a611cc03badf1f32b36/lgsm/modules/command_send.sh#L35C2-L35C8
If the command is run by a user in an interactive console, the user can easily respond to the prompt to get LGSM to act accordingly, but if the send command run by cron encounters this, the script will wait indefinitely for a response to the prompt. This will cause more and more of these processes to pile up and clog the system.
If you don't provide an actual command to send as a parameter in the send command used in cron, you'll get the same result.
My proposed solution is to make LinuxGSM aware of whether it's being run via cron or by a user to disable or skip all prompts & interactive behavior:
https://discord.com/channels/127498813903601664/1260724318665445497/1268171300694786048
Relevant log output
N/A
Steps to reproduce
- Install any gameserver that supports the send command (such as Minecraft)
- Stop the gameserver
- Add the following cronjob to your crontab (customize as needed)
* * * * * /home/user/gameserver send "some command"
- Wait for more and more proccesses to pile up while prompting the user whether to start the gameserver
Metadata
Metadata
Assignees
Labels
Type
Projects
Status