AutoRestart documentation page
If your server is managed by Multicraft control panel , restart won't occur.
Note: by default AutoRestart is disabled.
Note: When server is restarting the old server instance is not yet closed so you should have maxservermem*2 memory available in the system to restart properly. (You may want to increase your swap size on linux)
AutoRestart will automatically restart your server at a defined time.
Command
/asw restart (performs a restart manually)
Permission: autosaveworld.restart
Config values: (config.yml)
enabled: false #enable or disable AutoRestart broadcast: true #broadcast message about server is restarting time: []#List of times of day at which server will AutoRestart in format HH:MM example at the end of a page countdown: enabled: true #enable countdow before AutoRestart(will write messages about restart is soon in chat) broadcastonsecond: #list of seconds before restart to broadcast about server restarting soon. - 60 - 30 - 10 - 9 - 8 - 7 - 6 - 5 - 4 - 3 - 2 - 1 commands: [] #list of commands to execute before the restart will occur scriptpath: start.sh #path to your server startup script, even if AutoSaveWorld won't find, it it will still try to restart server. juststop: false #if true AutoRestart will just stop server instead of restart(useful for infinite loop script)
restarttime expample
time: - '03:20' - '16:24' - '20:03'
Is this the time of day or an interval? Perhaps make this more clear. If this is time of day then can it autoRestart more than once a day?
A suggestion: A schedule over a 24 hour period would be the best. That way it could be instructed to do a restart in the quieter times of day. Eg:
Would restart at 3am, 9am, 3pm and 9pm.
@monotonehell It's the time of a day at which server will autorestart.
Currently server can autorestart only once per day.
I will see what i can do with schedules.
@Shevchikden
I second this. It needs to be possible to restart multiple times per day. If I do not restart my server twice per day, it can easily reach 4gb of RAM consumption.
Okay i switched to list of times in test version
Format: hours:minutes
Release version coming out soon.
where should i put that start.sh? what file permissions should have start.sh?
@BiweGas it doesn't matter where the file is (and it's name), but in scriptpath you should put a path to that script.
For example you have file startmyserver.sh in your server directory, then in scriptpath you should put startmyserver.sh
Script must be marked executable
Note: if you define a wrong path in scriptpath server will still autorestart.
So AutoRestart is semi-functioning on my server? It's shutting the server down fine, but it doesn't seem to be starting it back up again. Thankfully I happened to be available 30min after the shut-down to prevent too much downtime...
crashrestart: enabled: true scriptpath: start.sh timeout: 60 juststop: false autorestart: enabled: true broadcast: true time: - '12:00' - '24:00' countdown: enabled: true seconds: 20 scriptpath: start.sh juststop: false
I don't think I've got anything wrong here in the config, and there are no errors or anything in the console.
I can't seem to get autorestart to work.
I set the config up as:
but when I restart the server or reload the config, it re-writes it as
and just doesn't work.
Any ideas?
@XombyCraft
It is still a valid format.
What exactly doesn't work?
Would it be possible to have the countdown timers displayed in minutes where appropriate instead of seconds? Ideally any multiple of 60 over 60 would be displayed in minutes.
@Omniwrath I will see what i can do.
For anyone having trouble with getting the right script path, it has to be the complete path. e.g. /home/namehere/Desktop/Server/start.sh works for me. I had trouble with that at first.
I'm struggling to fully implement AutoRestart.
I have tried placing a start.sh file with the jar files, and creating a full path like Stereo said below, but no matter what it gives me the message saying the startup script was not found. Then it tries to restart through other methods, and that seems to work about 50% of the time.
If the startup script is found, but just wrong, will it return a different error?
There is a Multicraft error that seems to stop the restart.
http://pastebin.com/MuCnD7Mu
As you can see at the bottom of that log, there is an error from Multicraft and this seems to prevent the restart every time. Is it possible to circumnavigate this?
@Omniwrath If startup sript is found ASW will tell it to console.
Multicraft spits error because i start process while this one is not yet finished, and multicraft tryes to write to this new process and breaks something. So probably after this multicraft forcefully shutdows server. I wil try to investigate it when my vacation will end.
@Shevchikden
If it would help to have access to one of my Multicraft servers just let me know. I will be happy to help with testing in any way.
How does the start.sh have to look like? I tried the following, but it doesnt work with the AutoRestart-Function.
I start the script inside a "screen". When I type "/asw restart", the server is counting down and stops. The Console ended just with:
The Config looks like this:
Starting the "start.sh" manually works fine.
Server Version: 1.6.2
@chatjack That script should do fine, but how are you checking for server running?
Because after restat there will be no console and you should check using other ways.
@Shevchikden
Hey, thanks for the fast reply. I installed now a fresh debian 6 distribution and sun-java6-jre. I administrate the server over SSH with putty, here is exactly what I do:
I logon over SSH as the user "minecraft". The "start.sh" is executable for everyone and looks like this now:
After logon I create a new screen-session.
After that I start minecraft with "./start.sh" from the Home-Directory of the User "minecraft". After the server started I logon with the minecraft client and restart the server with "/asw restart". Then the server.log shows this.
After that it throws me back to the shell, but the screen-session is still open and attached.
The Config looks like this.
Any ideas?
@chatjack
Check if you can connect to server using minecraft client after the restart.
It is the only way to check it.
The old process ends and that's why you are thrown to shell, but the new process is not attached to console.