Jump to content

Native Linux server (with management scripts)


Alloc

Recommended Posts

Oh, and another thing I've been noticing since a16...

 

I get this error in the log of whatever server isn't the first one to start....

2017-07-16T10:09:54 1.099 INF Failed to register the log file writer: Sharing violation on path /home/sdtd/engine/sdtd.log2017-07-16T10:09:54 1.102 INF   at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0 
 at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
 at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
 at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in <filename unknown>:0 
 at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0 
 at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool,System.Text.Encoding)
 at SdtdLog.Init () [0x00000] in <filename unknown>:0 
UMA Overlay loading took 1185 ms

 

I did go through and checked the a15 logs, and don't see this happening.

 

As Alloc answered to my question on the same here: https://7daystodie.com/forums/showthread.php?12837-Improvements-for-the-dedicated-server&p=671995&viewfull=1#post671995

 

Oh yeah, it's for the log-channel system the console guys added. It doesn't hurt, iirc by default nothing is enabled to go there anyway.
Link to comment
Share on other sites

As of the Alpha 16 release, I noticed that the current day in-game is no longer written in the log files. I was using this information on a website for players on my server. Is there another way to get the current day in-game from the server files on a linux server?

Link to comment
Share on other sites

As of the Alpha 16 release, I noticed that the current day in-game is no longer written in the log files. I was using this information on a website for players on my server. Is there another way to get the current day in-game from the server files on a linux server?

 

you could write a script that executes "gt" via telnet which returns "Day xx, hh:mm"

Link to comment
Share on other sites

Thanks, I will give that a shot.

 

I just made a quick test with nodejs yesterday to connect to telnet and get the live log. Maybe i'll provide a script with some settings you can then use if you like. Dont know you xp in javascript /node but i could create an api which returns the result as json for example.

 

I'm useing the webserver from allocs for my servers, there is a day displayed :)

Link to comment
Share on other sites

The following script could be executed with nodejs:

 

"use strict";
//exports.__esModule = true;
var net = require("net");
var port = 8081;
var host = "localhost";
var client = net.createConnection({port:port},()=>{


//console.log("Telnet connection established\n");


client.on("data",(c)=>{
let text = c.toString();


if(["\n","\r","\r\n"].indexOf(text)>=0) return;


if(text.match(/^day/i)){
 let data = text.split(" ");
 let day = data[1].replace(",","");
 let time = data[2];


 console.log(`It is Day ${day}! Time is ${time}.`);
 client.write("exit\r\n","utf8");
} else{


//  let out = text.replace(/\r\n$/gi,"").replace(/^\r\n/gi,"").replace(/^\n/gi,"");
//  console.log(out);
}
});


   client.on("end", function () {
       // ITS OVER!
       //console.log("Server gone!");
   });
        setTimeout((c)=>{ c.write("gt\r\n","utf8",()=>{
               //console.log("sent gt to telnet");
        }); }, 1000,client);
});


 

I hacked it in the server console, that is why its not very pretty, i'll make a cleaned up version later.

It will execute gt and then print something like:

 

It is Day 50! Time is 13:44.

 

on your servers console and then exits. You could use this maybe to fetch day in an interval x, save it to a text file and then read it from wherever you want.

I called the script main.js so in my case i would execute "node main > output.txt"

 

You could also let the connection open and have nodejs updating the data in output.txt, maybe save as JSON string.

Link to comment
Share on other sites

What is the state of linux server? I stopped running mine (and playing the game) in A14 d.t constant crashes caused by memory leak.

 

Is linhx server stable now?

 

I'm running a linux server since A11 (first ubuntu now debian) and it was always almost stable as it is right now. Ok sure, if you dont restart the server in periods it is getting unstable but with a daylie restart everything is fine except the "normal" alpha bugs

Link to comment
Share on other sites

I'm running a linux server since A11 (first ubuntu now debian) and it was always almost stable as it is right now. Ok sure, if you dont restart the server in periods it is getting unstable but with a daylie restart everything is fine except the "normal" alpha bugs

 

are you confirming the memory leak is still in the server build, and server needs to be restarted every singly day or it will crash?

Link to comment
Share on other sites

are you confirming the memory leak is still in the server build, and server needs to be restarted every singly day or it will crash?

 

I can't confirm because my restart script restarts the server for a long time now, over a year. Never tried to let it running again.

Link to comment
Share on other sites

  • 2 weeks later...

After starting a new save for a16 a few weeks ago and deleting my old save my automatic backups are no longer working. I can type 7dtd.sh backup and a backup is created. I haven't changed anything in my /etc/cron.d/7dtd-backup file. Here's what's currently in it.

 

0 * * * * root nice -n 15 /usr/local/bin/7dtd.sh backup

 

Any ideas why it won't do the backups automatically anymore?

 

Thanks

Link to comment
Share on other sites

Can you check what permissions / owner the cron file has?

 

Thanks for the reply. I did ls -l on the file and here's what I got:

 

-rw-r--r-- 1 steam steam 65 Aug 2 17:50 /etc/cron.d/7dtd-backup

 

I tried changing the owner and group to sdtd and also root and it didn't help. I also tried combinations of sdtd:root as well as steam:root.

Link to comment
Share on other sites

Update 16.2

 

I tried to update to version 16.2

 

I got the message:

 

Installing SteamCMD and 7DtD

 

Engine is already at the newest build (local: 1961860, remote: 1956030).

 

But it isn't version 16.2 and i can' t login to the server because it says that there is a version mismatch.

My client already has 16.2, but hte server is still runnin under 16.1

 

Will the script be updated?

 

Greets Marc

Link to comment
Share on other sites

Still not working

 

Thanks fpr the replies, but it still tells me, that i have the newest version, when i try to update.

I tried also the updateengine command. Same effect. It is a Linux server. The last Years the engine works fine. With Version 16 i made a complete new installation. everything works fine, Update 16.1, no problem. Now since 16.2 is out, the update will not work. After running the update (using root rights) it says that the newest version is installed. If i try to connect with my client it says that there is a server mismatch. Client is tunning 16.2, server runs 16.1. I have no idea what to do to fix the problem.

 

What shoult i run with --force? The Client?

 

Greet

Marc

Link to comment
Share on other sites

What shoult i run with --force? The Client?

The update.

First though please update the scripts again (also with --force as you're probably running an intermediate version of 109 already) and see if that already helps.

Link to comment
Share on other sites

Error Message

 

After running the updatescripts and the updateengine with --force i got the following message:

 

/usr/local/lib/7dtd/commands/updateengine.sh: Zeile 104: getRemoteEngineVersion: Befehl nicht gefunden

/usr/local/lib/7dtd/commands/updateengine.sh: Zeile 107: [: Zu viele Argumente.

Engine is already at the newest build (local: 1961860, remote: ).

 

Maybe i am forced to clean the server and setup a new one :(

 

Greets Marc

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...