Plugin category: [ADMN] or [MISC] Suggested name: CrashRestart (but really, name it whatever you would like ) Commands: I can't think of any commands, but if you do, then go ahead add it. Permissions: Permissions aren't necessary, but if you make a command, go ahead add one. What I would like: As seen with RemoteToolkit, a plugin can detect when a server gives a severe error / crashes, then restart the server automatically. I do use RemoteToolkit myself, but it has tons of features that I do not use. I'd prefer something a little lightweight, if that can be done. So, can a plugin developer make a plugin that detects a severe error / crash for me? If necessary, I can help you (figuring out this for myself is overwhelming). Thank you. When I'd like it by: Anytime before the Minecraft 1.3 (August 1st is planned deadline) is fine.
This would be useful, I've had a server hang multiple times and had to reset it manually... It's probably not that complicated.
O.K. I developed a startup script which startsup the server. Then, whenever the server stops, the console gives you 10 seconds to type CTRL+C (this stops the process). If you do not, then the server startsup again. I think this is the solution to the crash detection because I believe craftbukkit already stops the server on a severe error (can someone confirm this?). Since I'm a Mac, I wrote the script for Mac. I believe you don't have to change too much for it to work on Linux. As for Windows, this will be different. Script: Code: #!/bin/sh cd //The rest of your directory goes here! Example: /Users/number1_Master/Desktop/Server/ java -Xms[RAM]M -Xmx[RAM]M -jar craftbukkit.jar -nojline //Replace [RAM] with your desired amount while true do echo "=============================================" echo "To stop, hold down CTRL and C ( CTRL+C )!" echo "10 seconds until auto startup!" sleep 5 echo "You have 5 more seconds!" sleep 2 echo "3 ..." sleep 1 echo "2 ..." sleep 1 echo "1 ..." sleep 1 echo "Your Minecraft Server is starting up ..." echo "=============================================" java -Xms[RAM]M -Xmx[RAM]M -jar craftbukkit.jar -nojline //Replace [RAM] with your desired amount done
Well I have a script that handles this issue, my problem is when the server hangs but doesn't "shut down". That is a good solution though.
Same here. Is "hang" the more accepted term? I just say "lag out". Tends to happen with WorldEdit and TNT.
nunber1_Master I don't believe that this can be accomplished with a plugin as the plugin runs on the server itself whereas an external program such as RemoteToolKit can because it is running on the OS itself, not the server and is not affected by the crash. If the server is affected, the plugins will stop responding just like the server and will not be able to restart. In fact, I don't even believe that a plugin can start a server up once it's completely stopped.
Could you have an external plugin that pings the server every so often? And if the server is hanging, then it would end the process and start the server up?
Yeah, the plugin would call the program, because if the server is frozen, then the plugins are, too. How it would work: On plugin startup, it calls a program to run, the program will stay running, until the server crashes, (it would continuely ping it every 5 seconds or so) it would then issue a stop. Then reboot, and kill the program EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Issuing a stop doesn't work if the server is frozen. The whole process has to be ended entirely. On my Mac, I have to Force Quit the org.bukkit.craftbukkit.Main before starting the server again. EDIT: Read it again... Issue a stop, then reboot, then kill? How about just kill and reboot?
Well, the program would need to be killed otherwise it would continue running, and have multiple instances running at once, all doing the same job, so it would restart the server a thousand times
Well by a plugin, that is what I meant. That is pretty much what I was thinking! np98765 Ne0nx3r0 Ya, there still needs to be a work around for freezes. I'm only so smart.
I know a custom craftbukkit build that can restart server if it is frozen, mayby this[/url is what you search Code:yaml settings: timeout-time: 180 restart-on-crash: true
Oh, I'll do it now'ish nunber1_Master All Done, Only works on Windows (for now..) Download: https://dl.dropbox.com/u/51143191/ServerReboot.rar Instructions: ~~How to use~~ - Put the ServerReboot.jar in the main directory of your server, Then put the ServerRebootPlugin.jar into the plugins Directory.. Boot up your server, And All done, Notes: this plugin will only Run the 'Run.bat' file, Please don't use any other names. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Anything I can do to help you convert it to Mac? EDIT: I checked out the code. Maybe there can be a config file to name the startup script? Otherwise, there would need to be a different .jar for each script. EDIT: And if the server is frozen ... then wouldn't this code open a new window ... and the frozen server would still be up in the old window?
config file, Will work on it. I've Converted it to mac and linux if the server is frozen, It wont do anything, It'll only work when the server crashes. I'll add a few things, (Like a freeze detector) and a config soon. https://dl.dropbox.com/u/51143191/ServerReboot.zip Instructions in the .zip. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Code: #!/bin/sh cd //The rest of your directory goes here! Example: /Users/number1_Master/Desktop/Server/ java -Xms[RAM]M -Xmx[RAM]M -jar craftbukkit.jar -nojline //Replace [RAM] with your desired amount while true do echo "=============================================" echo "To stop, hold down CTRL and C ( CTRL+C )!" echo "10 seconds until auto startup!" sleep 5 echo "You have 5 more seconds!" sleep 2 echo "3 ..." sleep 1 echo "2 ..." sleep 1 echo "1 ..." sleep 1 echo "Your Minecraft Server is starting up ..." echo "=============================================" java -Xms[RAM]M -Xmx[RAM]M -jar craftbukkit.jar -nojline //Replace [RAM] with your desired amount done That script above is what I use (at the moment) whenever the server stops (crashes). Your plugin does the same, but in Java. If you add freeze detector and config, that would make your plugin amazing (also, make your plugin public, it should get a lot of downloads). Thanks man, you are the best!