MCMrARM / mcpelauncher-linux

Please note this is a legacy repository, please go to: https://github.com/minecraft-linux/mcpelauncher-manifest/wiki
GNU General Public License v3.0
312 stars 46 forks source link

[Server] Add /stop command #328

Open kherock opened 6 years ago

kherock commented 6 years ago

This would be neat since some web-based server panels expect to be able to shut down servers by passing in a text command. I could probably patch in a workaround myself to send an interrupt signal, but ideally we could have behavior that closely matches a Java edition server anyway.

This is awesome work by the way, keep doing what you've been doing!

MCMrARM commented 6 years ago

Hello, this is not within the scope of the launcher app itself. I plan to do a serverutils mod in the future that adds a few command (/stop, whitelist, bans) in the future but that's not something I want to do short term.

What you could do is to 'patch' the command in to the current codebase, if all you want is to having it working in console and not in-game.

codehz commented 6 years ago

I think it can be a mod api.

codehz commented 6 years ago

Oh, I think /stop command can be implemented by sending a signal to self pid..

nicman23 commented 6 years ago

does sigterm stop the server gracefully?

codehz commented 6 years ago

@nicman23 yes, you can send SIGINT(Ctrl+C) and it will be stopped gracefully