MinecraftServerControl / mscs

Powerful command-line control for UNIX and Linux powered Minecraft servers
https://minecraftservercontrol.github.io
BSD 2-Clause "Simplified" License
490 stars 61 forks source link

Fix and improve the world mirrors #157

Closed Wicloz closed 7 years ago

Wicloz commented 7 years ago

The current mirror system does not stop properly and is generally unreliable.

The stop and start functions have been changed to handle the starting and stopping of mirrors much more reliably (and actually work in the first place). The use of ramdrives as the mirror location has been taken into account. The stop and force-stop function have been improve to prevent issues with the mirrors being synchronized as the world is shutting down and saving. The syncMirrorImage function now uses rsync instead of cp. Backups have been slightly changed to work with these changes.

All changes are fully backwards compatible.

sandain commented 7 years ago

Thanks for the pull request! I'm going to need some time to review these changes -- I like that you kept each change separate, that will make it easier.

sandain commented 7 years ago

I just got done reviewing this. The logic looks correct. Have you fully tested all of these changes?

My only concern is that we are now adding rsync as a dependency. We should add a check similar to those found here and add documentation to the README.

zanix commented 7 years ago

I think rdiff-backup depends on librsync1 but not the entire rsync application. I believe rsync comes default in most distributions anyway.

Wicloz commented 7 years ago

I tested all the changes and am currently running this for my servers, with the mirror folder in a tmpfs. My world is still fine after multiple reboots and crashes.

sandain commented 7 years ago

I'm going to accept this PR, but I am disappointed that my request for an update to the README and a check for rsync at the beginning of the script was ignored. I'll go ahead and make those changes myself.

Wicloz commented 7 years ago

Sorry about that, I read between the lines too much and thought you intended to make the changes...

sandain commented 7 years ago

No worries! Thank you for getting this code straightened out.