Graceful Reboot

Discussion in 'Archived: Plugin Requests' started by Fyridor, Feb 24, 2011.

  1. Offline

    Fyridor

    Hello community,

    Back in my hMod days (like a month or two ago) I used to have this lovely simplistic, yet incredibely useful plugin called Graceful Reboot. I've used the search function on the Bukkit forums, but I could not find results that matched what I was looking for using either ''Graceful'' or ''Reboot'' or the combination of those two. I'd really, really, really love to have that plugin back and I don't think it would take thát long to port it over, as it is, or so it seems, very basic and simplistic.
    A quick description of what the plugin does:
    • It saves all chunks correctly upon rebooting (it is not actually a reboot, it just shuts the server down, needing me to restart the server manually, but at least it is more graceful than using /stop. I would love to have the choice between shutting the server down gracefully or the choice to shut it down, make a backup (adding a certain suffix or prefix, most definitely numeric) and then start again. But that might be too much to ask for, as the original plugin did not do that either.)
    • It creates a customizable message for all of the players on the server upon rebooting. (That way, you could say that you were shutting it down and that they could reconnect again in 20 or so seconds to the IP-address that your server was on)
    I hope that this will be looked into.
    Much obliged,

    ~Fyridor

    P.S. For those who need the original .jar, you can click here.
     
  2. Offline

    Bobby_Bonsai

    That's a little bit far stretched.

    First, I don't know of any other way then stop to stop the server. The only thing you could do is issuing a save-all before exit. But I'm 99% sure that the server does this anyway if it is stopped.

    Second, this would require to kick off an external process/program to do the backup and restart the server. To do it gracefully you'd have to query/monitor the server-process and see if it has already stopped (and you can do the backup without incident). Doing the backup and restarting the server is a piece-of-cake, but all the other things might turn cluttered and ugly. Especially the part with kicking off an external application leaves a bad taste in my mouth for some reason, I'm not sure why.

    Another solution would be, if you don't need the restart of the server for some reason, to create a cronjob and backup the world while nobody is online (and while the server is still running). I'm doing this with my private server because I know that no-one is online at 6 a.m..

    But I'll put it on my list to think about it.
     
  3. Offline

    Fyridor

    Hello Bobby_Bonsai,

    Thanks for your response.
    That whole backup thing was just an immense fantasy of mine, which will probably be very hard to realize anyway.
    The most important thing when using the /reboot command with Graceful Reboot was that you had a customizable message that could tell everyone what was going on, and you could also use it to temporarily kick everyone but admins or ops.
    Could you perhaps enlighten me more about that backup method that you are using? It would be awesome if I could use such a thing, as it would eliminate the need to shut the server down to backup all the time.

    If you are serious about actually creating this for real, I'd be happy to help you in any way possible. Would it be hard to port it from hMod to Bukkit? If not, I'll send you that .jar.

    Thanks again for the response and considering helping me out here.

    ~ Fyridor
     
  4. Offline

    Bobby_Bonsai

    My current backup solution is a simple cronjob (planned task if you come from Windows) which is scheduled for 6 a.m., because I know that no one is normally online at that time (private server). It just kicks off a script which packs the whole world, additionally to it I'm running my SaveStopper plugin, so I know that nothing will change while the backup is in progress (and nobody is online).

    It's a simple solution for me, and I think this should work for private servers which have a fixed time in which no one is online. The script boils down to a simple "tar -cjf /path/to/backup.tar.bz2 /path/to/world" command.

    I think the plugin could be compiled to a simple mechanism which:
    • Issues a custom message
    • Issues a save-all and save-off
    • Kicks off a custom process/command and waits for it to finish
    • Issues a save-on
    • Another custom message

    To allow easy customisation, I think a generic "To this at that time" plugin would be a nice idea. Something that kicks off scripts on specified times, a simple cron-clone for bukkit.
     
  5. Offline

    Fyridor

    Hello again Bobby_Bonsai,

    Thanks for your response.
    Alright, I'll try that out.
    And indeed, that would be a nice addition to Bukkit. It's not all about the big plugins, but the smaller ones can make usage of it so much easier and less time consuming (not that manually backing up is so insanely hard and time consuming, but you get the idea if you have 50 of those tasks to perform per hour, it does take some time).

    Thanks for looking into this. Again, if you need any assistance I could provide you, be sure to ask.

    ~Fyridor.
     
  6. Offline

    Bobby_Bonsai

  7. Offline

    DaPro30

  8. Offline

    Hafnium

    I simply use this as my launch batch file:

    Code:
    @ECHO OFF
    title Minecraft Server
    
    :minecraft
    
    echo (%time%) Minecraft SMP started.
    
    start /B /wait java -Xincgc -Xmx4G -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:+UseAdaptiveGCBoundary -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:SurvivorRatio=6 -XX:NewRatio=3 -XX:ParallelGCThreads=2 -XX:+AggressiveOpts -jar "%~dp0craftbukkit-0.0.1-snapshot.jar" nogui
    
    echo (%time%) WARNING: Minecraft SMP closed or crashed, restarting.
    timeout /t 15 /nobreak
    goto minecraft
    
    Fifteen seconds after a stop, the server runs again. That way, when I run stop in-game, it really is just a reboot.
     
  9. Offline

    dv90

    Already made this, it's called AutoStop.
     
  10. Offline

    Fyridor

    That wasn't entirely what I meant... I was looking for a plugin that would not only reboot, but also display a message to all those who were online at the time of the reboot to tell them it was just a reboot. On top of that, it had to backup my entire server folder to another folder and name it 1, 2, 3, etc. That last part is not what Graceful Reboot could do, but it is incredibely useful.
     

Share This Page