Setting up server to restart on crash

What’s the easiest to set up a server to restart after a crash? Is it possible from the web ui?

This is not possible from the webui because I can’t think of any way that (ordinarily) a user could tell whether a server crashed.

Checking if the server is up isn’t enough, in my opinion, because what’s the difference between ‘not up’ because it crashed, or ‘not up’ because it was deliberately taken down.

There are many ways people have tried to approach this–and they have varying levels of success for their own needs, but as there is no single answer for all users, it isn’t included as part of MineOS functionality.

Some ways people handle this outside MineOS:

  1. run a shell script that runs Minecraft in a loop. If it closes, it is relaunched again. (Realistically, this also means the server can never be taken down except by killing the calling process from terminal)

  2. run a cron job that checks if Minecraft is running on a port. If it’s not, launch it

Some ways people handle this within MineOS:

  1. run a cron job that checks if Minecraft is up. If it’s not, launch it. (this has the same downside as the previous #1 where it can’t tell whether you stopped it deliberately or if it crashed, but for people who think they want it up all the time, this works). The cron job subsequently has to be turned off before turning off the server for maintenance, updates, etc.