SmartRestart
SmartRestart
The amount of memory remaining before an automatic restart occurs can be customized. You can also configure the number of seconds between checking the amount of memory, as well as the messages displayed before and after the restart.
Official Website: MC.Candy-Sky.Net
The Current Features
- Adjust the amount of memory before an automatic restart
- Configure the amount of seconds between checking the server's memory
- Customize the text to display before the restart occurs
- Customize the text to display after the restart
Commands and Permissions
Permissions is "smartrestart.sr"
- /sr
- Display the free memory ,least free memory and check interval.
- /sr reload
- Reloadd the config.
- /sr restart
- Forced to restart the server.
Example the Config
# Designing by Taiwanese from Candy-sky.net # Check the time in seconds interval check-mem-time: 5 # Restart at least how much memory? free-mem: 100 # Restart messages closeinga-message: "Server out of memory! Restarting to ensure server stability. Do not shut down the server manually." closeingb-message: "Server shutting down in 10 seconds, log out now!" # message to display to kicked players restart-message: "Please wait 30 seconds before logging in to ensure system stability"
Example the Command start.bat for Windows
@ECHO OFF :restart echo run server now , you can't close java -Xmx1024M -Xms1024M -jar craftbukkit.jar echo Restart after 5 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 4 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 3 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 2 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 1 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul goto restart
Example the Shell Script start.sh for Linux
#!/bin/sh BINDIR=$(dirname "$(readlink -fn "$0")") cd "$BINDIR" while : ; do echo "run server now , you can't close" java -Xmx1024M -Xms1024M -jar craftbukkit.jar echo "Restart after 5 seconds , you can close now" sleep 1 echo "Restart after 4 seconds , you can close now" sleep 1 echo "Restart after 3 seconds , you can close now" sleep 1 echo "Restart after 2 seconds , you can close now" sleep 1 echo "Restart after 1 seconds , you can close now" sleep 1 done
Example the Shell Script start.sh for MAC
Theoretical writing Not been tested
#!/bin/bash cd "$( dirname "$0" )" while : ; do echo "run server now , you can't close" java -Xms1024M -Xmx1024M -jar craftbukkit.jar -o true echo "Restart after 5 seconds , you can close now" sleep 1 echo "Restart after 4 seconds , you can close now" sleep 1 echo "Restart after 3 seconds , you can close now" sleep 1 echo "Restart after 2 seconds , you can close now" sleep 1 echo "Restart after 1 seconds , you can close now" sleep 1 done
Changelog
- Version 0.4:
- Optimize detection and restart the code again.
- Fix "/sr reload" check interval constant error
- Version 0.3:
- Optimize detection and restart the code.
- Add "/sr" command to display the free memory ,least free memory and check interval.
- Add "/sr reload" to reloadd the config.
- Add "/sr restart" forced to restart the server.
- Version 0.2:
- Correct English syntax errors
- Automatically restart automatically displays the remaining memory to facilitate record
- Version 0.1:
- Initial release
Luv this plugin, it saved my server, "zimcraft.net". Please keep updating it! :c
Are you guys gonna keep updating this plugin as Minecraft and Bukkit update?! Reply?? Thanks! Love this plugin! Saved my server more than once!
不更新了嗎?拜託更新到1.5.2!
Hi! I love this plugin. I was using this plugin for many months. But I changed the version of the game to Spigot and this has stopped working. Can you do your support Spigot and SO Debian, plis?
我都必須要用這段才可讓伺服器自動重啟:
@ECHO OFF :restart echo run server now , you can't close "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" -Xms1024M -Xmx1024M -jar craftbukkit-1.4.7-R1.0.jar -o false echo Restart after 5 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 4 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 3 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 2 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul echo Restart after 1 seconds , you can close now ping -n 2 -w 500 0.0.0.1>nul goto restart
原本的那段要改一下才可以QAQ,是不是每個人的電腦不一樣,所以才不能?該不會作者您提供的是windows8用的?
另外,有沒有辦法新增固定時間重啟設定呢?
可以新增一個選項 來控制要不要再關機前踢人嗎? 我用MCPC1.4.7 有玩家在線上的話 重開就會失效
超讚 台灣人設計的
真棒!看到國字就覺得很舒服。
有玩家在線上就不會自動重開了 會出現以下錯誤
2013-01-27 01:34:13 [SEVERE] Exception in thread "pool-1-thread-331" 2013-01-27 01:34:13 [SEVERE] org.apache.commons.lang.UnhandledException: Plugin SmartRestart v0.3 generated an exception while executing task 22957 at org.bukkit.craftbukkit.v1_4_6.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.IllegalStateException: Cannot kick player from asynchronous thread! at org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer.kickPlayer(CraftPlayer.java:221) at org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer.kickPlayer(CraftPlayer.java:216) at tw.candy.SmartRestart.SmartRestart$2.run(SmartRestart.java:109) at org.bukkit.craftbukkit.v1_4_6.scheduler.CraftTask.run(CraftTask.java:53) at org.bukkit.craftbukkit.v1_4_6.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53) ... 3 more
@mitracraft
Found a fix :) Remove all non Latin characters from config. Upload config to server. Then open SmartRestart.jar winth winrar or something else, and replace config.yml with your config. The error should be fixed.
cane ay have source ?
There is a problem with some special characters in the Linux operating system. It would be better just to use the English language for the console. I leave you stuck down the error that I have been shown in the console. Thank you very much for the plugin.
Where I must put the start.sh file?
Hello,
I have been using SmartRestart for quite a while now, I think since September. Since then, I haven't had a SINGLE timeout or downtime due to server crash.
It took some time to find the "sweetspot" where my server "explodes". It usually accumilates RAM slowly, and then it spikes, the spikes are dangerous, they usually spike 2-3 GB ram and then it explodes. I set my restart to be at 2500 free MB (I use 8 GB total) and its working like a charm.
Best wishes from all the users of
mc.xeraingaming.com :)
The Mac version of the startup script works absolutely fine! It will give you some weird characters at the beginning, but then it will run perfectly and smoothly. Nice work, candy820522 and kgame!
@bradybell33
OKyou can try. I don't test......
Hey will you provide a script for the start up of mac... I cant find one anywere!
@joehot200
It might have something to do with CB version as well then, i'm using CB 1.2.5 because of mods
@Jabulba
uhm. i run linux and i dont have a problem.
why does the plugin crash MY WHOLE COMPUTER when it trys to restart the server!?