[INACTIVE][ADMIN/MECH/GEN] RestartNow v0.3_2 - Full server restarts [818 - 1060]

Discussion in 'Inactive/Unsupported Plugins' started by aidan matzko, Jun 5, 2011.

  1. RestartNow - Complete Restarts:
    Version: v0.3_2

    When i first joined bukkit, I was very surprised by the fact that there was no way to restart the server. Yes, there are toolkits and modified .bat's or .sh's, but why isn't there just a plugin? That's what this is for.

    • Full Server Restarts.
    • Compatible with any OS!
    • Compatible with any startup script.
    • Automatic restarts every x minute(s)!
    • Restart the server when there are no players on the server!
    • Reload the server when there are no players on the server!
    • Permissions/Group Manager support
    • Commands include:
      • /restart -- restarts the server
      • /schedulerestart <time + time unit> -- cancels all planned restarts and schedules the server to be restart in <time + time unit>
      • /resettimers -- cancels every planned restart
      • /kickall -- kicks everyone from the server, including yourself if its not from the console
      • /saveworlds -- saves all worlds
      • /reloadplugin <plugin> -- reload plugin X
      • /restartnow <update> -- displays general information and updates the server
    To Do

    • Wrapper -- High
    Known Bugs

    • After a restart linux users can't see the gui(it's still running!)
    • Does not work with MCMA(use its /restart command, not fixable by me)
    • /restartnow update does not download 0.3_1, please manually update till i get back
    • Update times are slightly screwed up (sorry :/) Will be fixed ASAP
    • You can't have a space from C:/(or your default drive) to craftbukkit.jar. A fix will be out soon
    • Configuration options still give an error when the config is setup wrong...

    Source Code

    How to Install:
    There is now a semi-complete wiki! hopefully this helps clear up any confusion.
    Wiki Here
    In linux if you restart the server, there will be NO console gui to type commands into. The server is still running, there is just no GUI. I can make it a simple light weight wrapper, comment on if you would rather have a console gui or a wrapper!

    • Version 0.3_2
      • Very important bug fix in restartNowMain.jar
    • Version 0.3_1
      • Fix notification times(again!)
      • Test updating from the console! Type /restartnow update ;)
    • Version 0.3
      • Huge update! Please delete your configuration file
      • API! Check the wiki for more information
      • Auto updating!(Give a huge thanks to @Adamki11 , he created the lib, and I modified to suit my needs)
      • Auto extracting! No more pesky zip file
      • Completely reworked structure.
      • Broadcast times FIXED!
      • Other various bug fixes
      • Added a github wikipedia
    • Version 0.2_1
      • Fix the Reload-Server problem
    • Version 0.2
      • New command. /reloadplugin <plugin name>. Pretty simple, reloads that plugin. Must be the same exactly spelling as the plugin when listed in /plugins
      • The command /schedulerestart <time> is changed to /schedulerestart <time + time unit> the time units are same for config as they are for this command.
      • Huge update for the config. Look at the documentation again ;)
      • Broadcast with X minutes left till restart!
      • The linux server is kinda fixed. Checkout above
      • No player reload.
      • Much more stable.
    • Version 0.1_2 -- Note quick reupload for Ubuntu users to change the way the .sh is opened
      • Full fix for Windows users. Upload now includes a bat file(windowsonly.bat) that is required for windows users.
    • Version 0.1_1
      • Fixed the duplicate command prompt error on Windows.
    • Version 0.1
      • It's out!
      • Added some changes from the beta version such as more commands, another safeguard, and improved permissions handling.
    Error Reports:
    • Please post feature requests/bugs to github, makes it easier to get them all!
    • If you would like to submit a bug(github/forum), please use this method:
    • Before you do anything, open a command line
    • cd to the server directory
    • type java -jar restartNowMain.jar "<name of bat or sh>" "<os name> "1"
    • Code:
      Config File
                                     The .sh or .bat you use to start the server
                                     What happened when you did the steps above with a command line?
  2. What? You mean find out how much memory each plugin is using? Or restarting the server on OutOfMemory
  3. Offline


    @ aidan matzko

    To find out how much the plugins are using. A lot of servers owners are complaining about the java out of memory errors that crash their servers. It would be nice to troubleshoot those things.
  4. I dont know if thats possible or not. Ill look into it...
  5. Offline


    I have the same problem... ^^
    When i start it and /restart it... the server restarts... but only THE FIRST TIME ^^ after that the server doesn't restart...
  6. Offline


    Just for anyone running linux, and wants minecraft to restart inside a screen session:
    Start minecraft from a script like so:
    while true; do
     cd minecraft #### Note: My script is outside of the minecraft folder, if it is inside, get rid of both cd commands in the script
     java -Xincgc -Xmx1G -jar craftbukkit-0.0.1-SNAPSHOT.jar
     sleep 15 ####### Note: This is so there is a pause between. Useful if you are running any IRC bot
     cd ../
    This causes the server to restart once it has been stopped safely, which you can do by disabling autorestart.
    Works with any schedules of restarts (now effectively autoshutdowns) and in the event you have to kill the server because java has gone to shit, will restart afterwards still.
    Just kill the script to be able to stop the server outright of course (not sure why you would want to do that), else it will keep rebooting

    Edit: Dont disable autorestart, it disables the plugin, just do a script file that doesnt exist for your restart script. It will just let the server shutdown
  7. Offline


    When i try to restart the server with /restart i become a error:
    11:00:31 [SEVERE] java.io.IOException: Cannot run program "java": java.io.IOException: error=12, Cannot allocate memory
    11:00:31 [SEVERE]       at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
    11:00:31 [SEVERE]       at java.lang.Runtime.exec(Runtime.java:593)
    11:00:31 [SEVERE]       at java.lang.Runtime.exec(Runtime.java:466)
    11:00:31 [SEVERE]       at com.tips48.restartNow.RestartNow.restartServer(RestartNow.java:193)
    11:00:31 [SEVERE]       at com.tips48.restartNow.RestartNow.onCommand(RestartNow.java:229)
    11:00:31 [SEVERE]       at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    11:00:31 [SEVERE]       at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
    11:00:31 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:304)
    11:00:31 [SEVERE]       at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:725)
    11:00:31 [SEVERE]       at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:691)
    11:00:31 [SEVERE]       at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:684)
    11:00:31 [SEVERE]       at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    11:00:31 [SEVERE]       at net.minecraft.server.NetworkManager.b(NetworkManager.java:223)
    11:00:31 [SEVERE]       at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    11:00:31 [SEVERE]       at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    11:00:31 [SEVERE]       at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
    11:00:31 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    11:00:31 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    11:00:31 [SEVERE] Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory
    11:00:31 [SEVERE]       at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
    11:00:31 [SEVERE]       at java.lang.ProcessImpl.start(ProcessImpl.java:65)
    11:00:31 [SEVERE]       at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
    11:00:31 [SEVERE]       ... 17 more
  8. It appears you ran out of memory.
    To everyone else:
    I will be home tonight on the way home now. I will quote everyones issue when i get home but from my iPod its too hard. Anyway...
    Planned for v0.3:
    For sure:
    API -- DONE
    Auto-updating -- DONE
    Auto-extracting(no more zip!) -- ALMOST DONE -- Works without errors(copies files twice)

    /restartnow , /restartnow update , /restartnow reload (reloads config) -- DONE
    /stoptimers -- DONE
    Automatic reloads
    No more need for OS-Name -- DONE
    Bug fixes:
    Possible linux fix -- Possible Wrapper
    Fix if you disable RestartNow with /reloadplugin -- DONE
    Possible features:
    Much better notify times
    Customizable messages(will be in 0.3) -- DONE

  9. wait what?
  10. Offline


    Running that script creates a loop where when the server stops running, it will wait 15 seconds and then start up again, so with your plugin config'd to shutdown automatically but not restart, it will restart through that script in the same session (whether that is the same window, or the same screen session, it doesnt matter)

    See my edit also, you dont set AutoRestart as false else it wont autoshutdown on schedule, you need to just set a bad script name, which will kill the java process and allow the script to restart
  11. err, ok then.
    SO, you mean that it allows a GUI on linux after the restart?
  12. Offline


    GUI (graphical user interface) isnt the right word as it is all CLI based (command line interface) but it does give you a UI (user interface), yes
  13. haha, sorry, i knew that ;) (been awake all night, brain fart)
    so, would there be any way for me to implement that into the plugin so something like that is not necessary?

    Just to let everyone know, 0.3 is coming along very nicely. I will update the post i made above with the features in 0.3 with the progress i am making on them. Expect a release sometime soon(within the next week at the latest)
    If there are any features if you want to see in 0.3, *please* say them now ;)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 16, 2016
  14. Offline


    2011-06-26 18:24:28 [INFO] Stopping the server..
    2011-06-26 18:24:28 [INFO] ConsoleCommandSender: Stopping the server..
    2011-06-26 18:24:28 [SEVERE] Could not pass event PLAYER_MOVE to MagicSpells
        at com.nisovin.MagicSpells.MagicPlayerListener.onPlayerMove(MagicPlayerListener.java:90)
        at org.bukkit.plugin.java.JavaPluginLoader$7.execute(JavaPluginLoader.java:285)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:139)
        at net.minecraft.server.Packet10Flying.a(SourceFile:126)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:399)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    This is the error I get every time the server restarts automatically.
  15. Not my error
  16. Offline


    If you had the owner launch minecraft from your jar file when they first launch, you could create a script to a similar effect. You could alternatively throw in a .sh script for linux users, say they must launch from that - this way they have some cutomization (I for example recently added into my script the below which will scan the world file for any corrupt chunks and fix them)
    java -jar /home/minecraft/chunkfixer.jar minecraft/world
    That said, having your own java based launcher with customisable command line options (this would be imperative to customise bukkit file paths) would be quite powerful - you could also add java remote consoles at a later date, or a feature that detects crashes (as in read time outs and so on that dont actually cause the server to go down) - pretty much any features that need to exist when the server starts

    If you save-all before you /restart, this will be avoided

    It isnt directly your error but this is because of people rejoining in the interval between the server kicking them and it shutting down, usually because of the length of time it can take for saving. Can create some significant lag - when I restart on a full server (15), around 10 people will rejoin and bigbrother will spew tonnes of errors (presumably youve severed the mysql connection by this point through your plugin, or you have disabled a dependancy)
    If you could block players from joining before it stops, this would be averted. I imagine something similar to a temporary whitelist after kicking is what you need, providing you could set a drop command such as "Server is restarting, be patient"

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 16, 2016
  17. i'll see if i can do something like on PLAYER_JOIN if isRestarting == true //a variable i already have, player.kick
    then i have to make an event listener, and do all this stuff, but oh well :p

    so your saying i should create a "wrapper"?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 16, 2016
  18. Offline


    Would be nice, although it isnt too imperative seeing as this is when it is shutting down
  19. good point.
    and hmm, interesting...

    Theres a semi-wiki up now, should clear up some confusion.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 16, 2016
  20. Offline


    02:10:30 [SEVERE] Could not load 'plugins/restartNowMain.jar' in folder 'plugins':
    java.io.FileNotFoundException: Jar does not contain plugin.yml
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:63)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:194)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:117)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:109)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:232)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:219)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:146)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
  21. restartNowMain.jar goes in the same folder as craftbukkit.jar, NOT in plugins.
  22. Offline


    22:53:58 [INFO] Stopping the server..
    22:53:58 [INFO] ConsoleCommandSender: Stopping the server..
    22:53:58 [INFO] Stopping server
    22:53:58 [INFO] Saving chunks
    22:53:58 [INFO] Stopping server
    22:53:58 [INFO] Saving chunks
    im using Ubuntu Linux if that helps
    java -Xms2048M -Xmx2048M -jar '/home/goomma/Bukkit/craftbkkit-0.0.1-SNAPSHOT.jar'
    is what i use to start the server
  23. How would that help? Or, well, whats your problem? :D
    wait, did you follow my last instructions. restartNowMain.jar *SHOULD NOT* be in /plugins/, only in the folder where craftbukkit.jar is.
  24. Offline


    I get this error in the console when the server starts up:
    15:40:17 [SEVERE] Error occurred while enabling RestartNow v0.2.1 (Is it up to d
    ate?): null
            at com.tips48.restartNow.RestartNow.checkReloadTime(RestartNow.java:732)
            at com.tips48.restartNow.RestartNow.onEnable(RestartNow.java:144)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:125)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:140)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:118)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:232)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:219)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:146)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Running 818, I updated to 860 and same problem. Here's a list of my plugins:
    I can probably find a plugin that lists my plugins + version numbers but if this problem is already known I would like to avoid unnecessary work. Any help would be appreciated, thanks!
  25. Offline


    148 recipes
    16 achievements
    17:12:47 [INFO] Starting minecraft server version Beta 1.6.6
    17:12:47 [INFO] Loading properties
    17:12:47 [INFO] Starting Minecraft server on *:25565
    17:12:47 [WARNING] **** FAILED TO BIND TO PORT!
    17:12:47 [WARNING] The exception was: java.net.BindException: Address already in
     use: JVM_Bind
    17:12:47 [WARNING] Perhaps a server is already running on that port?
    > ]
    17:13:00 [SEVERE] java.lang.NullPointerException
    17:13:00 [SEVERE]       at net.minecraft.server.MinecraftServer.b(MinecraftServe
    17:13:00 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftSer
    17:13:00 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(Sour
    17:13:00 [SEVERE] Unexpected exception
            at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:480)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:367)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    17:13:01 [INFO] Stopping server
    17:13:01 [SEVERE] java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    17:13:01 [SEVERE]       at java.util.ArrayList.RangeCheck(Unknown Source)
    17:13:01 [SEVERE]       at java.util.ArrayList.get(Unknown Source)
    17:13:01 [SEVERE]       at net.minecraft.server.MinecraftServer.stop(MinecraftSe
    17:13:01 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftSer
    17:13:01 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(Sour
    >press any key to continue...
    After the restart, appears this error.
    After stopping the server, port remains busy. How to fix it?

    PS: sorry for my English..
  26. @GlobuX in the config there is a setting Wait-Time, set that higher.
    @Stephen304 paste your config
    0.3 will be out soon!
  27. Offline


    Seem to be having some trouble when it outputs the time until restart.
    Each time it announces, it will announce immediately after it will happen in half that time
    So at 30 mins, it says 15 mins at the same time, and immediately says 5 mins after 10 mins
  28. Known bug
    EDIT: fixed in 0.3 when it comes out, i already have a fix done, i just need to do one more thing and 0.3 will be DONE
  29. Offline



    Your awesome, thanks for working with us. You one of the few that actually let us know your working on an update, .. So thank you:D. On a side note,.. have u considered working the thief plugin? Also, the members of The Wraithaven Server are interested in a couple more plugins, one for class change and one for pvp/guilds, that we would be willing to pay for, if your also interested in that idea, just a thought. :D
  30. Well, all my work right now is going into 0.3 and a upcoming Herobrine plugin(mwahahaha!), so not yet. I really haven't looked at it. I'll pm you when i have some time though, and maybe i can look at it :p
  31. Offline


    Good stuff man, really looking forward to 0.3.

    I'm new to this Bukkit stuff but this will work with the new recommended build for 1.7.2 right? Thanks again for all your hard work!

Share This Page