Native Linux server (with management scripts)

The following script could be executed with nodejs:

Code:
"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.

 
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?

 
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

 
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?

 
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.

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

I wrote up a bash script that runs every half hour via cron while the server is running. Works great!

 
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

 
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.

 
Yeah, cron files have to be root.root for security reasons, otherwise they aren't executed. With root.root though it should really work. Have you checked that it's still not executing after an hour?

 
I had mine stop once. Noticed that for some reason the owner/group had changed to the original user account created on the server. Changed it back to root, and restarted the server. Worked fine after that.

 
I changed to root:root and rebooted the server and now it's working again. The reboot was the only thing I hadn't tried before. I'll bet that was the issue. Thank you both for the help!

 
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

 
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

 
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.

 
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

 
Back
Top