Skip to content

[Bug]: LGSM proccesses piling up when using the send command via cron on stopped gameserver #4621

@MicLieg

Description

@MicLieg

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

  1. Install any gameserver that supports the send command (such as Minecraft)
  2. Stop the gameserver
  3. Add the following cronjob to your crontab (customize as needed)
    * * * * * /home/user/gameserver send "some command"
  4. Wait for more and more proccesses to pile up while prompting the user whether to start the gameserver
    image

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    👀 In Review

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions