Paper: How to stop PaperMC when not in console

Created on 18 Dec 2018  ·  5Comments  ·  Source: PaperMC/Paper

Hi,

I am running PaperMC in a Dockerfile. But I want to restart the whole server every 24 hours because I think it is not save to keep it running and make a backup while it is running, right?

So how do I gracefully restart the server when I am on the shell but not inside the PaperMC console? Can I somehow attach to it and then do the “stop” somehow? And how do I know If it worked? How are you guys restart and make backups of your server? Thank you for your help.

question

All 5 comments

you can attach to it,
docker attach DOCKER-ID or Name(if you set that up)
to enter /stop

or use rcon, this is how we do it on our servers.

If you properly set up the Docker container and the Java process receives the signals you should be able to shutdown the server cleanly using docker kill -s SIGINT <container>. That's equivalent to typing CTRL+C which is more reliable than typing a command.

But how do I inform the logged in people in the server? Here, look at my problem in detail:

https://stackoverflow.com/questions/53842226/docker-using-screen-to-shut-down-minecraft-server-via-cron-job-does-not-work

How do you guys solve this whole problem? Here is the code on github: https://github.com/mtoensing/Minecraft-Paper-Server-docker

I suggest you to join the discord as questions like this can be answered faster în direct communication.
https://discord.gg/jETyjUw

as above, I'd suggest using discord/irc for communication, it's more direct and doesn't resolve in the issue tracker turning into a forum which just spams our inboxes;

as for your issue, you need to find a way to send a message to the server to close it, be that some plugin which lets you shove messages around rabbitmq or redis or something equivelent, or attaching to the docker container to send your stuff (noting that there are libraries for java and docker, if you wanted to go that route), ultimately, you're going to need to find a way to interface with the running process or the container itself

Was this page helpful?
0 / 5 - 0 ratings