Page 1 of 1

Need Ubuntu Autorestart script for my Server.

PostPosted: Tue Apr 12, 2016 11:48
by Lejo
Problem detached!
I need a script to restart my server "Subgames for all!" after a shut down.
The Version of ubuntu is 16.04 LTS.
In the moment I start the server with this command:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest --server --worldname Subgames

The Port is 30001 and the server don't need to shutdown regularly.
Can I place the script everywhere or must be it in a special order?

Please help me to restart the Server automatic.
Thanks.

Re: Need Ubuntu Autorestart script for my Server.

PostPosted: Tue Apr 12, 2016 11:51
by Lejo
I need a script to restart my server "Subgames for all!" after a shut down.
The Version of ubuntu is 16.04 LTS.
In the moment I start the server with this command:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest --server --worldname Subgames

The Port is 30001 and the server don't need to shutdown regularly.
Can I place the script everywhere or must be it in a special order?

Please help me to restart the Server automatic.
Thanks.

Re: Need Ubuntu Autorestart script for my Server.

PostPosted: Mon Apr 25, 2016 08:20
by cheapie
If all you want is for it to start back up when it shuts down, try this:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
while true; do minetest --server --worldname Subgames; done

Re: Need Ubuntu Autorestart script for my Server.

PostPosted: Mon Apr 25, 2016 16:49
by Lejo
cheapie wrote:If all you want is for it to start back up when it shuts down, try this:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
while true; do minetest --server --worldname Subgames; done

I will try it thanks. :)

Re: Need Ubuntu Autorestart script for my Server.

PostPosted: Mon Apr 25, 2016 17:01
by Lejo
Thanks a lot. :)

Re: Need Ubuntu Autorestart script for my Server.

PostPosted: Thu Apr 28, 2016 05:36
by DI3HARD139
Create a .sh file to be used as a starting point then copy the code into it and save. I suggest storing in your home directory so you don't have to cd to get to it. Then just do ctrl+alt+T ./<scriptname>.sh
Credits to VanessaE
https://forum.minetest.net/viewtopic.php?id=4604

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
while true
   do
   sleep 1
   minetest --server \
      --config <dir to minetest.conf for server> \
      --worldname <WorldNameHere> \
      --port <ServerPortHere>\
      --logfile <Dir to debug.txt>
done

Re: Need Ubuntu Autorestart script for my Server.

PostPosted: Thu Apr 28, 2016 17:23
by Lejo
Thanks again but I have still a script from: cheapie
It works fine.
But thanks too.

Re: Need Ubuntu Autorestart script for my Server.

PostPosted: Thu Apr 28, 2016 19:43
by rubenwardy
The second script is better as it will stop / slow down a crash loop from filling up a folder and potentially crashing the OS.