Restarting (whole server)

I was wondering if i reboot the (whole server) not minecraft server, while a minecraft server is running will it shutdown correctly and not cause courrption or do i have to manually turn off the mc server?

Well, the answer to that I’m not really sure of, however when I shutdown or reboot my server with commands or the button (tapping it once for like a sec, which runs the shutdown command) it never has caused corruption to the world data or any data in general. Normally when you shutdown/reboot, the OS would notify programs that it is shutting down, and from there programs will stop what they’re doing, save what they need to save, then close (unless it’s something like MS Office where it’ll prevent shutdown with a dialog of save, don’t save, and cancel).

When restarting the web ui from commandline, the servers that were up remain up, however I don’t really know whether or not that is the case with it comes to shutdown/reboot commands, but maybe the OS notifies java directly of the shutdown and the jar handles saving the world and closing the server, or maybe the web ui gets notified and runs the stop command in console to close the servers; honestly I don’t know the answer but for me I’ve never experienced corruption from doing that, however don’t quote me on that as I could be wrong.

There are really two problems you have to consider when rebooting your server without shutting down your minecraft servers first:

This is really not an issue, since the OS handles all files correctly in a shutdown process, including ending running services and applications. It do not however care, or think about save-state beyond telling the running services and apps “shutting down, please end now”. This leads to your other consideration.

Lost work / world parts:
This is more of an issue, sine your minecraft servers are run as java applets, so when you reboot your system it is java that gets told to end all activity, not your servers. I suspect that when java gets told to shut down it may just end all active java threads without telling the threads to end activity nicely. This means that your minecraft servers are simply killed instead for shut down. This means that your server may not run a propper save all then shut down routine. Without the save-all, anything done, built, or discovered will be lost since this exist only in memory and not on disk untill the world is saved to disk.

This is the worst case, it might be that java handles shutdown by telling the java-applets (your servers) running to end all activity and shut down, then your servers will have a chance to save-all and none is lost.

I would say that rebooting without at least logging in to your minecraft servers and firing off a “save-all” command in each is risky, but it might go well. You do not need to fear corruption, since a reboot lets the filesystem handle all stored files properly.

1 Like