Killing Docker Containers - What's The Worst That Could Happen?
Using Pterodactyl allows you to send the kill command to a container after stopping it gracefully with the "Stop" button, with the red "Kill" button appearing to forcefully halt the hanging container process. This can be used if you are trying to stop a server which has freezed, don't want the server booting again or just not being patient and like living life on the edge!
Each reason for killing a container has their benefits and drawbacks, ranging from nothing substantial happening to losing server data! Take precaution when using the kill feature!
Minecraft Servers
Killing Minecraft servers is not recommended in the slightest. Minecraft has two systems, it's worlds and it's plugins, if you run a modded version of MC. Worlds save at the end of the server shutdown to prevent the world save overwriting any final plugin changes.
The below information doesn't apply to proxy based jar systems, such as BungeeCord, Velocity or Waterfall. Although it is good to wait for these to shutdown safely, you are at a much lower risk of causing data loss unless the developer can't code properly. Sometimes you even have to kill the server to start it again if you input a invalid entry into the config.yml/config.toml or it will just hang its Java process.
When running a server, the vanilla MC jar has a built in auto-save system, which means any fork or development of the normal jar such as Paper, Spigot or Sponge will have this feature built-in and cannot be removed.
The auto-save timer is 10 minutes. When you kill the server, you run the risk of losing any progress on your worlds between 1 second and 9 minutes 59 seconds, dependent on how unlucky you are. It's a luck based system as you won't know when the server last saved, so ideally run /save all before turning off your server to prevent any loss of data.
This is the sole reason you have lost server data and a rollback has occurred, or even worse, plugin configuration files reset. There isn't any other explanation such as us not copying files properly between two servers, downloading from another hosting provider for your migration or anything like this. It's your own negligence.
It doesn't matter if you run a different server jar like WineSpigot where it can modify your stop command, such as reboot in 1 instead of stop. Update your stop command appropriately.
Killing a server CAN WIPE configuration files. We've seen it happen, do not ignore this warning. Don't do it unless extremely necessary and you have appropriate backups. Some plugins are written extremely poorly and will pull their configs on server boot to the RAM, and if the server does an unsafe shutdown, it will not return the config back to the file.
Examples include PlayerVaultsX, where a player was inside their vault at the time of the reboot and it immediately got wiped due to a server kill, Essentials loosing homes/nicknames and many more. We repeat, DO NOT ignore this warning.
Discord Bots
These run using different Eggs installed on the panel such as NodeJS or Python. When you add the Egg, either by us or yourself, you need to remember to update the name and shutdown command in the Egg. Go to Nests on the admin side of the panel > The Nest name you set it to such as "Discord" then click the Egg itself, such as "NodeJS". Rename the "Name" under the "Configuration" section and "Stop Command" under the "Process Management" section.
Killing a Discord Bot is pretty safe and shouldn't cause any issues, as the stop command in my case is "Ctrl + C" denoted by ^C above. This will safely shutdown the server anyway as it's simply stopping such process from running, but if you forget to update the stop command, it's not the end of the world. Most Discord Bots run as a terminal process like NodeJS or Python, so Ctrl + C is not going to cause data loss.