• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

The server turns itself off

Dorianek

Member
Joined
Nov 29, 2018
Messages
247
Reaction score
10
Location
Poland
if the message at server startup has been executed as root user, please consider running it as a normal user. can it cause the server to turn itself off after about 5-6 hours? because at night I run 23 PM. / morning in the morning 6-7AM the server is off I do not know where to look for reasons will someone advise? tfs 1.3 hardware is a dedicated rl map 24gb framework
 
Your server is probably crashing
If he says it crash 6-7AM consistently, crash cant be so consistent. What i think hes using globalevent that shuts down the server (maybe)
XML:
<globalevent time="06:55:00" name="ServerShutdown" script="shutdown.lua" />/code]
 
Some servers it is "Global Save" or "Globalsave" look into your config.lua and globalevents if there's something that shutdown the server.
 
The problem still occurs I am unable to provide a putty log because the server works on / screen and the computer is off the server turns off the hour ~~ 6-7AM

Globalevents Autosave.lua

Rich (BB code):
local cleanMapAtSave = true

local function serverSave(interval)
    if cleanMapAtSave then
        cleanMap()
    end

    saveServer()
    Game.broadcastMessage('Server save complete. Next save in ' .. math.floor(interval / 60000) .. ' minutes!', MESSAGE_STATUS_WARNING)
end

function onThink(interval)
    Game.broadcastMessage('The server will save all accounts within 60 seconds. You might lag or freeze for 5 seconds, please find a safe place.', MESSAGE_STATUS_WARNING)
    addEvent(serverSave, 60000, interval)
    return true
end


maybe there is something wrong with this script?
 
Probably is this serversave.

You can use this one just ajust your time in globalevents and the warning message.
Code:
local function saveServer()
    cleanMap()
    broadcastMessage("Clean map completed and the next clean at on 5 hours.", MESSAGE_STATUS_CONSOLE_RED)
end

function onThink(interval)
    broadcastMessage("Cleaning map in 5 minutes.", MESSAGE_STATUS_WARNING)
    addEvent(saveServer, 5 * 60 * 1000)
    return true
end

Also I think you can use this restart.sh
Code:
#!/bin/bash
ulimit -c unlimited
while true; do ./tfs --log-file "output.txt" "error.txt"; done

Put in the same place your tfs file is, and instead of execute tfs, execute restart.
It will save your screenlog even if the server closes, and if the server closes will automatically re open.
 
ok, the script works, but how to fix this error, by which server turns off at a given hour, I get a message somewhere about how the server will turn off now, why did it happen?
 
So we bet now that the guilty may be serversave?
If I turn off the server in the morning, will there be a log from this event somewhere? where can I find him?

I already have a script from a colleague above to restore the server after the crash, but I would like to eliminate such a crash once a day because it is also not normal for the server to close automatically once a day at a given time.
 
The restarter did not help the server just switches itself off at this time

log from otservlist.org
Last online: June 18, 2019, 5:59 am CET

I will try the way from gpedro and let me know tomorrow whether it helped
 
The server continues to turn itself off at these times or can someone help me ?? I do not have an error with the console because the computer is usually turned off at night and the server was active by the screen command

Otservlist.org
Last online server : June 19, 2019, 5:54 am CET
 
The server continues to turn itself off at these times or can someone help me ?? I do not have an error with the console because the computer is usually turned off at night and the server was active by the screen command

Otservlist.org
Last online server : June 19, 2019, 5:54 am CET
check you logs folder
 
If you were so grateful and stressed which log you mean because I do not know myself anymore
inside your data folder you'll find a folder called logs inside that folder you'll find a folder called server in there you'll find a file called out.log open it it saves all the crashes report and errors of your server
 
Back
Top