Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Kill server correctly #25

Open
JoeNorth opened this issue Jun 7, 2016 · 8 comments
Open

Kill server correctly #25

JoeNorth opened this issue Jun 7, 2016 · 8 comments
Milestone

Comments

@JoeNorth
Copy link

JoeNorth commented Jun 7, 2016

Instead of killing the server process with SIGTERM, shouldn't it be done safely doing something like

this.execute("stop");

so the server can shut itself down and not potentially lose data?

@jaredallard
Copy link
Collaborator

Hey, yes this should be done. SIGTERM isn't appropriate anyways, stop is the way to do it and set a timeout for SIGKILL in-case of memory issues and other things I encountered running a Minecraft Server instance on my DigitalOcean droplets where it doesn't listen to signals or stop.

@jaredallard jaredallard added this to the v6 milestone Jun 8, 2016
@mdcfe
Copy link
Collaborator

mdcfe commented Jun 8, 2016

The problem with a SIGKILL timeout is that large servers can take a long time to shut down safely while smaller servers should shut down quickly.

@jaredallard
Copy link
Collaborator

@md678685 Yeah, a timeout is not ideal. Something like a force stop endpoint would be good.

@JoeNorth
Copy link
Author

Minecraft's native rcon server might be a better way to handle sending commands to the server if it pings back when the server is down or we can just detect when the connection has died and then know the server is down also.

@mdcfe
Copy link
Collaborator

mdcfe commented Jun 12, 2016

@JoeNorth I've been considering writing a plugin to utilise RCON instead of stdin, however this means more configuration for the Minecraft server and could potentially also be less reliable than just writing to stdin. Also, I don't think Glowstone supports RCON (may be wrong though). It would probably be better to leave this to a plugin rather than implement into Core.

@jaredallard
Copy link
Collaborator

@md678685 Could easily just modify server.propeties. Already have a good plugin for that, then just use node-rcon.

@JoeNorth
Copy link
Author

@jaredallard I think going with RCON could be a better solution going forward, especially if managing multiple servers in a single NodeMC instance is something to be added in future versions. For a single MC instance using STDIN is fine but ultimately isn't very scalable. Beyond that, the current implementation requires NodeMC to be run on the same server as the MC instance which is simply not feasible on a lot of hosting platforms. With RCON, the server can be running on any host, given they allow you to enable RCON, and NodeMC can be run locally.

The only downside I see to running RCON is that the protocol isn't secure (to my knowledge) so passwords, commands, ports, etc. are all sent as plaintext.

@mdcfe
Copy link
Collaborator

mdcfe commented Jun 12, 2016

@JoeNorth NodeMC is a wrapper around Minecraft servers, and either way you still need to read stdout and stderr since the console isn't output over RCON as far as I'm aware. (I fail to see the point of running NodeMC locally? Starting, configuring and restarting servers won't work - there's no universal way to do that remotely.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants