Open GCPins opened 4 years ago
This will also start your server if it is not already open. Click "Stop" to prevent it from reopening. If the server does not start when you click start, click "Now" to start the server - the AutoRestart system should now work fine.
This is about the worst idea of all. Often times on crash, the world save file will corrupt. Each time you restart due to a crash more often than not a rollback occurs also.
Quite a few have tried this. The issue is as soon as the server restarts it wipes the prior world save, and saves it even when it starts and is corrupted, then you have issues begin to arise.
Highly don't recommend auto-restarting, especially when you're away/asleep for a prolonged time.
This is about the worst idea of all. Often times on crash, the world save file will corrupt. Each time you restart due to a crash more often than not a rollback occurs also.
Quite a few have tried this. The issue is as soon as the server restarts it wipes the prior world save, and saves it even when it starts and is corrupted, then you have issues begin to arise.
Highly don't recommend auto-restarting, especially when you're away/asleep for a prolonged time.
This is a temporary fix for the time being before this feature is implemented (if it ever is). The world save files will not always become corrupted. This is an alternative to manually starting your server after every crash. In addition, I don’t see how starting the server manually (not using AutoRestart) would be any different. If the file corrupts during a crash (which hasn’t happened to me yet - I have done several tests), then starting it manually will not resolve the issue. This is more of a keep alive feature and doesn’t shut down the server while it is running. This only serves to start up the server if it crashes - it will not fix corrupted world files.
Okay then, won’t add this then, what’s wrong with the built-in mod anyway?
There is a built in mod for restarting the server?
I also don’t see Warpig’s point - if a crash corrupts the world files, regardless of the process you use the restart the server, the file will remain corrupted. An auto save feature using a similar method with .bat files could be implemented, but I don’t believe it will work as the server has to be in “save hold” or stopped via the console.
This is about the worst idea of all. Often times on crash, the world save file will corrupt. Each time you restart due to a crash more often than not a rollback occurs also. Quite a few have tried this. The issue is as soon as the server restarts it wipes the prior world save, and saves it even when it starts and is corrupted, then you have issues begin to arise. Highly don't recommend auto-restarting, especially when you're away/asleep for a prolonged time.
This is a temporary fix for the time being before this feature is implemented (if it ever is). The world save files will not always become corrupted. This is an alternative to manually starting your server after every crash. In addition, I don’t see how starting the server manually (not using AutoRestart) would be any different. If the file corrupts during a crash (which hasn’t happened to me yet - I have done several tests), then starting it manually will not resolve the issue. This is more of a keep alive feature and doesn’t shut down the server while it is running. This only serves to start up the server if it crashes - it will not fix corrupted world files.
The difference, when manually restarting, you can choose to re-upload a recent backup that's not corrupt. If you auto-restart, and the corrupted world is up for six hours before you wake up, then you're either going to have to severely annoy your users and revert to a six hour ago backup, or deal with the corruption as it gets worse by not reverting back.
This is about the worst idea of all. Often times on crash, the world save file will corrupt. Each time you restart due to a crash more often than not a rollback occurs also. Quite a few have tried this. The issue is as soon as the server restarts it wipes the prior world save, and saves it even when it starts and is corrupted, then you have issues begin to arise. Highly don't recommend auto-restarting, especially when you're away/asleep for a prolonged time.
This is a temporary fix for the time being before this feature is implemented (if it ever is). The world save files will not always become corrupted. This is an alternative to manually starting your server after every crash. In addition, I don’t see how starting the server manually (not using AutoRestart) would be any different. If the file corrupts during a crash (which hasn’t happened to me yet - I have done several tests), then starting it manually will not resolve the issue. This is more of a keep alive feature and doesn’t shut down the server while it is running. This only serves to start up the server if it crashes - it will not fix corrupted world files.
The difference, when manually restarting, you can choose to re-upload a recent backup that's not corrupt. If you auto-restart, and the corrupted world is up for six hours before you wake up, then you're either going to have to severely annoy your users and revert to a six hour ago backup, or deal with the corruption as it gets worse by not reverting back.
This is assuming you have backups available. There isn’t currently an auto save feature. However, you can elaborate on the process I mentioned and use .bat files and xcopy/robocopy to restore a backup if the server crashes unexpectedly.
Multiple users have had this issue, also, not only myself. Just wait until it does eventually happen to you, took me around a week for it to happen with a constant 35+ users on concurrently.
You would need to manually save the server however, as auto save features I have been testing are inefficient and are so far unsuccessful.
You can't auto-save if it crashes. What I'm saying is simple, you can't predetermine a crash. You can't just back it up seconds before a crash. The easiest thing you can do to back your world up which most do, is save hold your world every 4-6 hours, then restart your server. This way there is minimal issues.
Multiple users have had this issue, also, not only myself. Just wait until it does eventually happen to you, took me around a week for it to happen with a constant 35+ users on concurrently.
I see. The main issue with the crashing (on another users server with this software) has issues with Hack Clients and the “Crasher” module. During testing, after a user crashed the server, there was no corruption. I was unable to determine the rollback, but it was not severe, though it may be around 5 minutes (or more).
What's your Telegram handle? We can discuss there.
You can't auto-save if it crashes. What I'm saying is simple, you can't predetermine a crash. You can't just back it up seconds before a crash. The easiest thing you can do to back your world up which most do, is save hold your world every 4-6 hours, then restart your server. This way there is minimal issues.
Sorry if my previous comment was misleading. I never was under the impression you could save after a crash. The bat files would restore a previously saved backup like you described to the worlds folder. However, this is assuming the server loses all progress during the crash, so it would cause a severe rollback.
I don’t have a telegram, but I have a discord if you would like that.
I don’t have a telegram, but I have a discord if you would like that.
That works.
[GC;] Edvardlasting Darkness#6503
There is a built in mod for restarting the server?
Yes, it’s unsurprisingly called: crash-handler and it can be enabled in the custom.yaml file However, I do not know how good it will be at restarting the server as, once again, I can’t exactly test it.
It doesn't restart the server, but as i mentioned it seems to protect it from file corruption during a crash to some extent
Well, wasn't that the problem with your method? What if you used your method and the crash handler?
I have it enabled atm, so I’ll run some tests on how the crash handler manages a crash.
Ok, let me know what the results are
Good news!
The crash handler works like a charm. Whenever a crash occurs, the world files are saved. Using the method above with the crash handler enabled works a charm. I did adjust the "Check every_" settings on the Shutter application. I adjusted the checking time for when the server is stopped to a few seconds (instead of 10). There appears to be no rollback during a crash when crash handler is enabled, and shutter automatically restarts the server within a few seconds. Using the method above, after a crash your server files will remain saved, and the server will be back online in 30 seconds or less.
Great, should I close this now?
Uhh.... slight issue... It turns out that the crash-handler mod doesn't do anything about the crashes, it just allows data to be used to help stop these happening in the future, just checked its code... sry about any mis-conceptions
Strange. It saves anyway during a crash (no idea why) so I’m not that deterred.
I may add this to the wiki
I may add this to the wiki
I see. I may of mentioned this earlier, but Force Kicking players seems to save the server as well. The server also seems to save when a player leaves voluntarily.
Windows 10: how to configure your server to automatically restart after a crash.
Download shutter (scheduling application - this is safe to use if taken from the correct website). Configure new events as follows: 1.) Process; name: bedrock_server_mod.exe. Trigger when: stops; check every (any number you want). 2.) Process; name: bedrock_server_mod.exe. Trigger when: starts; check every (any number you want). Actions 1.) Run program (bedrock_server_mod.exe) 2.) Run preset; name: KA
Go to presets and click save/save as, and name it KA. Click save. To start the AutoRestart, click "Start". Whenever your server crashes (generally from Hack Clients), the console/server will close. Shutter will reopen it and restart the checking process when the server reopens.
You can edit the shutter settings to run in the background and other stuff, but I'm not explaining that here.