[MOD] Autorestart server for Linux [autorestart]

trukoil
Member
 
Posts: 145
Joined: Mon Oct 22, 2012 03:32

[MOD] Autorestart server for Linux [autorestart]

by trukoil » Sat Jun 06, 2015 01:30

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
Attachments
autorestart.zip
(919 Bytes) Downloaded 79 times
Last edited by trukoil on Fri Jun 19, 2015 11:48, edited 3 times in total.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [MOD] Autorestart server [autorestart]

by Krock » Sat Jun 06, 2015 06:01

"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.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

trukoil
Member
 
Posts: 145
Joined: Mon Oct 22, 2012 03:32

Re: [MOD] Autorestart server [autorestart]

by trukoil » Sat Jun 06, 2015 14:17

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 ;)
 

trukoil
Member
 
Posts: 145
Joined: Mon Oct 22, 2012 03:32

Re: [MOD] Autorestart server [autorestart]

by trukoil » Fri Jun 19, 2015 07:26

Update 1.1
1.1 wrote:Fix: code to secure launcher script
TODO: exit script if Minetest exits normally
Attachments
autorestart_1_1.zip
(942 Bytes) Downloaded 69 times
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [MOD] Autorestart server [autorestart]

by rubenwardy » Fri Jun 19, 2015 07:41

You should say Linux only in the first post.
 

trukoil
Member
 
Posts: 145
Joined: Mon Oct 22, 2012 03:32

Re: [MOD] Autorestart server [autorestart]

by trukoil » Fri Jun 19, 2015 11:49

rubenwardy wrote:You should say Linux only in the first post.


Thanks, post and discussion updated.
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: [MOD] Autorestart server [autorestart]

by Hybrid Dog » Fri Jun 19, 2015 16:22

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.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 13 guests

cron