pelican-eggs / eggs

Service eggs for the pterodactyl panel
MIT License
2.81k stars 2.32k forks source link

[Bug]: Dont Starve Together #2651

Open KenRen98 opened 8 months ago

KenRen98 commented 8 months ago

Panel Version

1.11.4.0

Wings Version

1.11.8.0

Service

second shard

Modified

No, I did not modify the egg

Expected Behavior

main process and co process run normally. so two shards would run in one docker image.

Actual Behavior

co process dies/pauses when mod is added ( this is a preexisting problem in this egg for long time, and appear to be version irrelevant ), no matter if which ( master or cave ) is in co process, only main process lives after few seconds.

Steps To Reproduce

Add some mods (maybe more than 4 or 5) to the server that's going to be run on co process, after few seconds, the CPU utilization will drop and if you check server.log, it will stop at random places. (But when shutting down, some lines might get added at bottom of the file)

I checked many things and it appears to be not the problem of the game itself, if you swap master/cave server in run command, the one in main process will always run properly, co process dies. (also tried swapping world setting from normal to cave world, no difference)

suspected reason: Docker issue, co process command is not running properly in Docker.

@gOOvER @parkervcp @QuintenQVD0 Tested Solution (if the approach is acceptable, I will do pull request in yolks and eggs):

  1. Added Supervisord in source image build https://github.com/KenRen98/yolks/blob/194069609907bc96fcf122f6103fe1b839782f0d/games/source/Dockerfile

  2. Added Supervisord configuration to run two processes (this will be in eggs, just for convenience I put it there) https://github.com/KenRen98/yolks/blob/194069609907bc96fcf122f6103fe1b839782f0d/games/source/supervisord.conf

  3. New startup command to run the Supervisord with the config supervisord -c ./supervisord.conf & sleep 5 && supervisorctl -c ./supervisord.conf fg master

  4. Termination command remain the same Cave will turn off when master turns off, just no output for user ( Supervisorctl is not exiting forground mode automatically ) So there will be about 10-60 seconds waiting cave to exit without any output.

  5. Below is the new egg that I tested , you can test it too. Please use this image: docker.io/kenren98/games:source

egg-don-t-starve-together---n-e-w.json

Install logs

https://pteropaste.com/44g3h2mv0yf8

KenRen98 commented 8 months ago

In case who needs to test it, below is a pair of tested config files for DST, GitHub does not support lua upload, please change file name yourslef. This would reproduce the problem, and show my solution works. Please also note that these would not cause any runtime errors for the server (no compatibility issue)

modoverrides.txt dedicated_server_mods_setup.txt

parkervcp commented 8 months ago

@KenRen98 You can PR your changes to the yolks and eggs repos

KenRen98 commented 7 months ago

@KenRen98 You can PR your changes to the yolks and eggs repos

I have created PR request for both of eggs and yolks. Currently I haven't find a good solution to shutdown both Master and Caves automaticly, I will leave that to you guys.

In yolk PR, I have posted some methods I have tried to fix that, but non of them worked.

Thanks for replying and giving attention to this outdated game anyway. lol

parkervcp commented 7 months ago

I am sure we can get modded servers to run without supervisord

KenRen98 commented 7 months ago

I am sure we can get modded servers to run without supervisord

Well, more than happy to see.