Page 1 of 1

[MOD] Autorestart server for Linux [autorestart]

PostPosted: Sat Jun 06, 2015 01:30
by trukoil
Attention: Linux only

Mod that kill and restart server if server is hanged for some mods.

Still buggy, strangely kills the server if there's low activity, i don't know if Minetest stops to run lua when no player are playing.

The mod itself is just a timetracker that writes a timestamp in /tmp, the script is the one that checks, should be used as launcher.

Highly experimental and unstable. Uses bash and date.

License: WTFPL

Edit 2015-06-19: updated version 1.1 here

Re: [MOD] Autorestart server [autorestart]

PostPosted: Sat Jun 06, 2015 06:01
by Krock
"Turn it off and on again" is just a soulation to solve the problem for a short time.
If you want to have no lags, you need a faster computer and internet connection or just a more efficient network code.
Restarting the server is definitely no soulation for this problem.

Re: [MOD] Autorestart server [autorestart]

PostPosted: Sat Jun 06, 2015 14:17
by trukoil
There are plenty of servers in public list that hang (read as: inaccessible server for hours or days until the admin login to the server host and restart manually) for a mod written not so well.
This mod is a quick-n-dirty approach to make server back online instead of waiting that the admin of the server notices the downtime or that someone writes that in a thread in the forum, not a definitive solution i know, that would be well written mods. This mod should be useless because this behavior should be implemented directly in minetest server, but could be pretty hard to modify the main loop (is Minetest using a main loop with events to run? Pretty all gui applications do this, don't know for Minetest honestly).

Variable lag is just the time that you can see in max_lag when you type /status, probably useless and just for test, but i'm still learning to mod ;)

Re: [MOD] Autorestart server [autorestart]

PostPosted: Fri Jun 19, 2015 07:26
by trukoil
Update 1.1
1.1 wrote:Fix: code to secure launcher script
TODO: exit script if Minetest exits normally

Re: [MOD] Autorestart server [autorestart]

PostPosted: Fri Jun 19, 2015 07:41
by rubenwardy
You should say Linux only in the first post.

Re: [MOD] Autorestart server [autorestart]

PostPosted: Fri Jun 19, 2015 11:49
by trukoil
rubenwardy wrote:You should say Linux only in the first post.


Thanks, post and discussion updated.

Re: [MOD] Autorestart server [autorestart]

PostPosted: Fri Jun 19, 2015 16:22
by Hybrid Dog
Krock wrote:"Turn it off and on again" is just a soulation to solve the problem for a short time.
If you want to have no lags, you need a faster computer and internet connection or just a more efficient network code.
Restarting the server is definitely no soulation for this problem.

No, you don't need a faster computer, you need mods which don't cause weird and/or unnecessary lag.
BTW: l made a mod which should do something like a scheduler in minetest https://github.com/HybridDog/function_delayer
it can be used to e.g. only spawn saplings if it's not lagging or…
https://github.com/HybridDog/conifers
l hope that it works.