gekware / minecraft-server-hibernation

Autostart and stop minecraft-server when players join/leave
GNU General Public License v3.0
384 stars 38 forks source link

java server process keeps running when msh exits because of a panic #106

Closed gekigek99 closed 1 year ago

gekigek99 commented 3 years ago

(... the running instance of the minceraft server, prevents msh from launching an other instance of the server)

case:

result:

cause:

solution:

gekigek99 commented 3 years ago

Especially check function servctrl.killMSifOnlineAfterTimeout() since it kills only the java parent process and not the java server process.

A useful function to implement might be osctrl.KillProcessTree.

gekigek99 commented 2 years ago

recover() function in main() could check if the server is running and in that case kill the process before the panic exit

gekigek99 commented 1 year ago

recover() function in main() could check if the server is running and in that case kill the process before the panic exit

not possible as recover() works only for panics in the subroutine

gekigek99 commented 1 year ago

added fix for linux in 9897f0c92e0dedaaf4fccca5e071509115dfb805 (NOT TESTED)

A complete solution would be using cgroups (linux) and/or job objects (windows) (gist)

Considering that there is msh pterodactyl-egg which solves completely the issue by rebooting the whole container in case of msh panic:

For now this issue is halted

might even be closed in the future as it's a very complex solution for a problem (random panics) that should not exist.

gekigek99 commented 1 year ago

corrected 9897f0c92e0dedaaf4fccca5e071509115dfb805 in f186b330f5dc2edaee4fd69a0b4cb041f47f6e08 as Pdeathsig is not supported on darwin OS

gekigek99 commented 1 year ago

Closing as halted