[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.


    Features:
    • 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...
    Downloads

    Jar
    Source Code

    How to Install:
    There is now a semi-complete wiki! hopefully this helps clear up any confusion.
    Wiki Here
    LINUX BUG
    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!

    Changelog:
    • 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. yes, soon the config will have it where you select minutes, hours, days, or seconds for your option...
     
  3. Offline

    Missnostalgia

    Ahhhh, that is great thanks for looking into it. Is it possible for you to add AM or PM? Not sure if you could do that, cause I wonder if you set it to how many hours will it count the morning or afternoon XD.
     
  4. Offline

    pyros

    Hmm I have all my configs set up as I believe they should be but the server still comes to a stop without restarting

    Config file
    <code>
    #RestartNow Config
    #Sun Jun 05 15:22:38 EDT 2011
    No-Players-Restart=false
    Automatic-Restarts=false
    No-Player-Time=15
    OS-Name=Ubuntu
    Craftbukkit-Launcher=run.sh
    Automatic-Restarts-Time=3600
    Wait-Before-Start=1
    </code>

    run.sh:
    -rwxr-xr-x 1 minecraft minecraft 66 2011-06-07 07:19 run.sh

    <code>
    #!/bin/sh
    java -Xincgc -Xmx1G -jar craftbukkit-0.0.1-SNAPSHOT.jar
    </code>
     
  5. Whats the first part
    -rwxr-xr-x 1 minecraft minecraft ?

    well, theoretically if there was a way to check the system time (which i know there is. Google xD), i could add that. I think if i just parse for S, M, H, or D, it should work fine, so i could use that for AM and PM
    Look for it in 0.3ish!

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

    pyros

    Its the chmod code -- 755, output by ls -l

    Also, is autorestart in seconds or minutes? Could do with some guidance in your config RE time options
     
  7. yes i know, soon it will be specified.
    anyway, the restarts are all in minutes, except for the wait time, which is in seconds.
    did you get it to work?
     
  8. Offline

    pyros

    Still no luck, I cant see where the bug here is, seems to me it just isnt running the script?
    Although even when I just put the command straight into the file, it doesnt work
     
  9. Yes, it isnt getting executed. Open a cmd and:
    Cd to server directory
    Type
    Java -jar restartNowMain.jar "<sh name> "ubuntu" "1"
    Assuming your on ubuntu, if not change to bat name and windows
     
  10. Offline

    pyros

    By <sh name> you mean shell name?
    Running $java -jar restartNowMain.jar "bash" "ubuntu" "1" gives me
    <code>
    java.io.IOException: Cannot run program "gnome-terminal": java.io.IOException: error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
    at java.lang.Runtime.exec(Runtime.java:610)
    at java.lang.Runtime.exec(Runtime.java:448)
    at java.lang.Runtime.exec(Runtime.java:345)
    at com.usa.tips48.restartNowMainDirectory.Main.main(Main.java:30)
    Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
    at java.lang.ProcessImpl.start(ProcessImpl.java:81)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
    ... 4 more
    </code>

    This seems to be a problem with the plugin as it tries to access gnome-terminal (something no dedicated server would have) instead of bash
     
  11. ok, thank you. Currently, this program uses gnome-terminal to restart the server on Mac OS X and Ubuntu. Obviously, i didn't think ahead that most dedicated servers wouldn't have this. I'll think of a alternative and post it up quick...
    Thanks

    Quick reupload for Ubuntu users.

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

    pyros

    Hmm still no autorestart, and running the jar itself gives this
    $ java -jar restartNowMain.jar "ubuntu" "1"
    Failed to load Main-Class manifest attribute from
    restartNowMain.jar
    or (seeing as you told me to include the shell in the first post on running this)
    $ java -jar restartNowMain.jar "bash" "ubuntu" "1"
    Failed to load Main-Class manifest attribute from
    restartNowMain.jar
     
  13. wow, sorry im a retard xD
    fail eclipse user, lemme reupload in a sec
    EDIT: also, shouldn't it be "bash.sh"?

    fixed. sorry, i was trying to put a quick fix out there for you and failed :p

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

    pyros

    Ah, you meant the shell script, I thought you meant the shell (/terminal) which in my case is bash
    Will try the update when I next restart
     
  15. Offline

    esiao

    Here is my problem
    Code:
    java -jar restartNowMain.jar "lancer.sh" "Ubuntu" "1"
    java.io.IOException: Cannot run program "gnome-terminal": java.io.IOException: error=2, No such file or directory
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
            at java.lang.Runtime.exec(Runtime.java:610)
            at java.lang.Runtime.exec(Runtime.java:448)
            at java.lang.Runtime.exec(Runtime.java:345)
            at com.tips48.restartNowMain.Main.main(Main.java:30)
    Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
            at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
            at java.lang.ProcessImpl.start(ProcessImpl.java:81)
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
            ... 4 more
    
    lancer.sh is my shell to start my server. The /restart doesn't work.
     
  16. Offline

    pyros

    I also got this when testing it out, wasn't going to comment until id tried a restart and done it through the server
     
  17. Thanks, i know the problem. I thought that update would fix it, but apparently doesn't...
    I think i have another update, i'll check it out...
     
  18. Offline

    Suembeaux

    so i got everything to work including all the commands, but i have a problem still. after i manually restart my server with /restart i am not able to log back on. any thoughts?

    - but when it automatically restarts at the timed commands it does just fine.
     
  19. glad to hear its working, but your not able to log in? Are you kicked from the server when its shutting down? I don't believe that is an error that my plugin would cause, as it does not handle anything after the server starts back up..

    Expect 0.2 out tomorrow, just got the one showstopping bug fixed (thanks #bukkitdev!)
    It will have better config handling, and whatever else i can squeeze in there

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

    Suembeaux

    well thats the thing, im playing on the same computer as im hosting my server and as i watch the cmd window load everything up it all looks normal...but when i go to log back in it does that whole connecting to server....for like 5 minutes and then tells my my connection has timed out. and yes it does kick me when i use the /restart command

    but as a side note it is wonderful except for that! and i can totally deal with just not using that command i was just testing if it was starting the server the way i wanted it to and it totally was! :D
     
  21. ok, sweet! I haven't had any problem with logging in, are you positive its my plugin? Try removing it and testing ;)
    Wait, it only happens on /restart? Glad to hear you like it :D
     
  22. well, i've been having alot of bugs, so 0.2 might come tomorrow :/
     
  23. Offline

    Ryan Palkovic

    This is a GREAT idea, now if I can get it working it'll be an AWESOME plugin!

    I've got restartNowMain.jar in the server directory.
    I've got restartNow.jar and the RestartNow directory in the plugins/ directory
    I've set up config.properties to have my OS (ubuntu) and my start script (runmc.sh)
    I run the server as a user called minecraft, all files are owned by that user, and all files are chmod'd to 777 (essentially, fully read/writable by anyone).

    I can start the server and get no errors in the logs, and I can use all of the commands I've tested... But as far as I can tell the app will not restart the server after it's been stopped, whether I use the /restart command or whether it restarts automatically.

    I ran the troubleshooting command from the server directory:
    minecraft@MC-PC:/home/minecraft/bukkit$ java -jar restartNowMain.jar "runmc.sh" "ubuntu" "1"
    minecraft@MC-PC:/home/minecraft/bukkit$

    If I'm watching top (kind of like windows task manager) I'll see the java process start and stop quickly, but no results are posted to the terminal window - basically looks to me like nothing is happening.

    I'm running Ubuntu 11 on a 64 bit processor using the SunJDK 64bit for linux if that's of any help.

    === config.properties ===
    #RestartNow Config
    #Sun Jun 05 15:22:38 EDT 2011
    No-Players-Restart=true
    Automatic-Restarts=true
    No-Player-Time=15
    OS-Name=Ubuntu
    Craftbukkit-Launcher=runmc.sh
    Automatic-Restarts-Time=10
    Wait-Before-Start=10

    === runmc.sh ===
    #!/bin/sh
    PATH=$PATH:/usr/java/jdk1.6.0_26/jre/bin
    cd /home/minecraft/bukkit/
    java -Xmx4096M -Xms4096M -XX:+UseFastAccessorMethods -XX:+AggressiveOpts -XX:+DisableExplicitGC -XX:+UseAdaptiveGCBoundary -XX:MaxGCPauseMillis=500 -XX:SurvivorRatio=16 -XX:+UseParallelGC -XX:UseSSE=3 -XX:parallelGCThreads=2 -jar /home/minecraft/bukkit/craftbukkit-0.0.1-SNAPSHOT.jar

    Thoughts? Questions?
     
  24. @Ryan Palkovic thanks a TON for the detailed error report. I currently know that restartNow is not working with linux or os x systems. It would/will be fixed in 0.2, which i was expecting to come out with yesterday, but i have had the same error for 8 hours now and still haven't been able to solve it. If i can't fix it by tomorrow, i will hopefully come out with another hotfix (v0.1.3) to fix it. Theres only bug stopping me from releasing 0.2, but once i get it, 0.2 will be out :p

    Well making 0.2, i *accidentally* made a /pluginreload feature. Should reload only that plugin ;) Need to test it, but that will be in 0.2 once i fix this one error!

    0.2 will come today. Fixed the bug, finally.
    Features:
    Plugin reload-Reload only one plugin
    Broadcast message when server is x time away from restarting(not finished yet)
    Much better command/config parsing(adds second, minute, hour, day!)

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

    kahlilnc

    Would this be compatible with server hosting or a brohoster control panel?
     
  26. it should be!
     
  27. Offline

    kahlilnc

    I might try this after i fall asleep and wake up again.
     
  28. I would wait about 3/4 hours because there will be a big update out that will be much more stable.

    Got all the bugs worked out, look for it in a hour or so

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

    noahwhygodwhy

    sigh...tried this out cause this is exactly what i need, but got an error

    config:
    Code:
    #RestartNow Config
    #Sun Jun 05 15:22:38 EDT 2011
    No-Players-Restart=false
    Automatic-Restarts=false
    No-Player-Time=15
    OS-Name=Windows
    Craftbukkit-Launcher=MCS #1.bat
    Automatic-Restarts-Time=120
    Wait-Before-Start=15
    
    consol:
    Code:
    148 recipes
    16 achievements
    14:07:48 [INFO] Starting minecraft server version Beta 1.6.6
    14:07:48 [INFO] Loading properties
    14:07:48 [INFO] Starting Minecraft server on *:25565
    14:07:48 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-766-
    g3fc0460-b818jnks (MC: 1.6.6)
    14:07:48 [INFO] Preparing level "world"
    14:07:48 [INFO] Preparing start region for level 0
    14:07:49 [INFO] Preparing start region for level 1
    14:07:49 [INFO] Preparing spawn area: 0%
    14:07:50 [INFO] DataSourcePool [MinecartManiaCore] autoCommit[false] transIsolat
    ion[SERIALIZABLE] min[2] max[20]
    14:07:50 [INFO] SubClassFactory parent ClassLoader [org.bukkit.plugin.java.Plugi
    nClassLoader]
    14:07:51 [INFO] Entities enhanced[0] subclassed[2]
    14:07:51 [INFO] Permission system not detected, defaulting to OP
    14:07:51 [INFO] [Annoyer] Annoyer has been enabled!
    14:07:51 [INFO] [BananaChunk] version 4.5 is enabled!
    14:07:51 [INFO] [ChopTree] Permissions not detected, defaulting to ops.
    14:07:51 [INFO] ChopTree 1.23 enabled!
    14:07:51 [INFO] ChunkRegenerate version 1.1 is enabled with op-only permissions!
    
    14:07:51 [INFO] DungeonGenerator version 1.0 is enabled with op-only permissions
    !
    14:07:51 [INFO] Permission system not detected, defaulting to OP
    14:07:51 [INFO] [EasyFlight] version [0.3] is Enabled.
    14:07:51 [INFO] EmptyInventoryPlus version 0.2not enabled. Permissions was not d
    etected
    14:07:51 [INFO] [EmptyInventoryPlus] Plugin disabled. (version0.2)
    14:07:51 [INFO] [EmptyInventoryPlus] Plugin enabled! (version0.2)
    14:07:51 [INFO] Loaded Essentials build 2.3.1 by Zenexer, ementalo, Aelux, Brett
    flan, KimKandor, snowleo, ceulemans and Xeology
    14:07:51 [INFO] Loaded EssentialsChat build 2.3.1 by Zenexer, ementalo, Aelux, B
    rettflan, KimKandor, snowleo, ceulemans and Xeology
    14:07:51 [INFO] Loaded EssentialsGeoIP build 2.3.1 by Zenexer, ementalo, Aelux,
    Brettflan, KimKandor, snowleo, ceulemans and Xeology
    14:07:51 [INFO] This product includes GeoLite data created by MaxMind, available
     from http://www.maxmind.com/.
    14:07:51 [INFO] Loaded EssentialsProtect build 2.3.1 by Zenexer, ementalo, Aelux
    , Brettflan, KimKandor, snowleo, ceulemans and Xeology
    14:07:51 [INFO] Loaded EssentialsSpawn build 2.3.1 by Zenexer, ementalo, Aelux,
    Brettflan, KimKandor, snowleo, ceulemans and Xeology
    14:07:51 [INFO] LavaFurnace loaded: 2 Furnace(s)
    14:07:51 [INFO] LavaFurnace config file finished loading...
    14:07:51 [INFO] LavaFurnace: Permissions not detected switching to Server OPs pe
    rmission
    14:07:51 [INFO] LavaFurnace version 1.1b is enabled!
    14:07:51 [INFO] [LockChest] Enabled
    14:07:51 [INFO] [Minecart Mania] Debug mode switched to NORMAL
    14:07:51 [INFO] [Minecart Mania] Attempted update failed - Backup config file -
    renamed MinecartManiaLocale.xml to MinecartManiaLocale.xml.bak
    14:07:51 [INFO] [Minecart Mania] Created new config file - MinecartManiaLocale.x
    ml
    14:07:51 [INFO] [Minecart Mania] MinecartManiaCore version 1.2.8 is enabled!
    14:07:51 [INFO] MoveCraft 0.6.9 Final Beta plugin enabled
    14:07:51 [INFO] [mxRingplatform] Permission system not detected, defaulting to O
    P
    14:07:51 [INFO] mxRingplatform v 1.0 enabled
    14:07:51 [INFO] [OpenInv] version 1.3.1 is enabled!
    14:07:51 [WARNING] [PanelMaster] : Could not load id file
    14:07:51 [INFO] [PhysicalShop] version 7 enabled
    14:07:51 [INFO] [RestartNow] v0.1.2 ready to restart!
    14:07:51 [INFO] [RestartNow] Permissions not detected.
    14:07:51 [INFO] SearchIds version 2.3 is enabled!.
    14:07:51 [INFO] SearchIds: Updating data from https://github.com/mrapple/SearchI
    ds/raw/master/search-ids-data.xml...
    14:07:53 [INFO] SearchIds: Update complete!
    14:07:53 [INFO] SecretDoors v0.2 by MrChick enabled
    14:07:53 [INFO] [SimpleChestLock 0.5] Permissions plugin not found, defaulting t
    o OPS CHECK mode
    14:07:53 [INFO] [SimpleChestLock 0.5] Enabled!
    14:07:53 [INFO] Superpickaxe v0.1 by DiddiZ enabled
    14:07:53 [INFO] WorldEdit 4.4 enabled.
    14:07:53 [INFO] WorldEdit: No known permissions plugin detected. Using configura
    tion file for permissions.
    14:07:53 [INFO] [xWarp]: No Register found. Deactivating Register support.
    14:07:53 [INFO] [xWarp]: 25 warps loaded
    14:07:53 [INFO] [xWarp]: No permissions system found until here. A permissions p
    lugin will be maybe activated later.
    14:07:53 [INFO] [xWarp]: Linked with economy system: Essentials v2.3.1
    14:07:53 [INFO] [xWarp]: xWarp 2.11.3 enabled
    14:07:53 [INFO] [Minecart Mania] MinecartManiaChestControl version 1.2.5 is enab
    led!
    14:07:53 [INFO] Done (0.473s)! For help, type "help" or "?"
    >restart
    14:10:50 [INFO] [Annoyer] Annoyer has been disabled!
    14:10:50 [INFO] [BananaChunk] version 4.5 is disabled!
    14:10:50 [INFO] [ChopTree] Saving changes...
    14:10:50 [INFO] [ChopTree] Saved changes.
    14:10:50 [INFO] ChopTree disabled!
    14:10:50 [INFO] ChunkRegenerate version 1.1 is disabled!
    14:10:50 [INFO] DungeonGenerator version 1.0 is disabled!
    14:10:50 [INFO] [EasyFlight] version [0.3] is Disabled.
    14:10:50 [INFO] [xWarp]: Deactivated economy system.
    14:10:50 [WARNING] [xWarp]: Skiped disabled economy system: Essentials v2.3.1
    14:10:50 [INFO] [xWarp]: No economy system found until here. A economy plugin wi
    ll be maybe activated later.
    14:10:50 [INFO] LavaFurnace saved 2 furnace(s)
    14:10:50 [INFO] LavaFurnace version 1.1b is disabled!
    14:10:50 [INFO] [LockChest] Disabled
    14:10:50 [INFO] [Minecart Mania] MinecartManiaCore version 1.2.8 is disabled!
    14:10:50 [INFO] MoveCraft 0.6.9 Final Beta plugin disabled
    14:10:50 [INFO] mxRingplatform v 1.0 disabled
    14:10:50 [INFO] PanelMaster : Plugin disabled
    14:10:50 [INFO] [RestartNow] Server is restarting
    14:10:50 [INFO] SearchIds 2.3 disabled
    14:10:50 [INFO] SecretDoors v0.2 by MrChick disabled
    14:10:50 [INFO] [SimpleChestLock 0.5] Disabled!
    14:10:50 [INFO] Superpickaxe disabled
    14:10:50 [INFO] [xWarp]: Close connection!
    14:10:50 [INFO] Stopping the server..
    14:10:50 [INFO] ConsoleCommandSender: Stopping the server..
    14:10:50 [INFO] Stopping server
    14:10:50 [INFO] Saving chunks
    14:10:50 [INFO] Saving chunks
    14:10:50 [INFO] Stopping server
    >Press any key to continue . . .
    restart:
    Code:
    C:\Users\Noah\My Folder\Minecraft\CraftBukkit\Server #1>taskkill /fi "windowtitl
    e eq MC"
    
    INFO: No tasks running with the specified criteria.
    The syntax of the command is incorrect.
    
    C:\Users\Noah\My Folder\Minecraft\CraftBukkit\Server #1>start <MCS #1>
    
    C:\Users\Noah\My Folder\Minecraft\CraftBukkit\Server #1>
    oh, and i'm running windows 7 64 bit
    i think i know what's wrong, i just don't know how to fix it. you said the name of the cmd prompt title should be MC? as you said yourself the instructions are a bit lacking. though any help would be highly appreciated. I've just never had the chance to mess around with bats so i don't know that much.
     
  30. Thats interesting. Does the server start back up? Also, what is the *title* of the command prompt. All it should say is MC. if it says something like C:\system32\cmd.exe MC or administrator - MC, then you need to not run it as administrator. sorry, theres not really much i can do about it :/
     
  31. Offline

    noahwhygodwhy

    sigh...ok, thanks for responding.
     

Share This Page