Jump to content

Native Linux server (with management scripts)


Alloc

Recommended Posts

Thank you Alloc,

 

Wow. I feel like an idiot. I had a server that was not working (which has been blown away many iterations ago), and my quick test since this was not working was to check via telnet. On connecting 7dtd direct to the IP of the server, I do see it is working correctly. Many apologies for overlooking this basic networking principle.

 

Doesn't seem to be said enough in this forum, but thank you for you time and effort allowing us to run these servers! And thank you for the quick support within this forum!

Link to comment
Share on other sites

By minimap you mean the ingame one? Could you make a screenshot? Haven't heard of anything like that before.

 

yeh here is public map you can see it and zoom in.. http://map.kraftzone.net/7dtd/

 

i would mind letting all players view the map to see landclaims (no live positions or inventory), but i have the main webserver passworded so its not really possible to get that updated list through the api without exposing the password

 

hope you add in some perms for level or access to features like live player positions/landclaims/view inventory or multiple password access to the main webserver directory soon, I have been wanting to let few people get access to that with there own user/pass or at least a different password anyway

 

7dtd.sh start <instance>". If the instance is running anyway it won't do anything and if not it starts it.

 

after posting I had a look into it and noticed the same, so I did cron exactly like that, less complicated than i thought it might have been :D

Link to comment
Share on other sites

map/0/0/-1.png it is a file.. its 127byte .png with a little red question mark on a white background 8x8pixels :D

 

how that got generated no idea.. but I did try delete it, refreshed the public map and it got generated again

 

maybe that was just a coincidence.. how to get it to rerender that tile again properly

Link to comment
Share on other sites

2014.09.21 17:46:31: Error getting entity player for ClientInfo: System.NullReferenceException: Object reference not set to an instance of an object

2014.09.21 17:46:31: at AllocsFixes.CommonMappingFunctions.GetEntityPlayer (.ClientInfo _ci) [0x00000] in <filename unknown>:0

2014.09.21 17:46:31: Error in AllocsLogFunctions.PlayerDisconnected: System.NullReferenceException: Object reference not set to an instance of an object

2014.09.21 17:46:31: at AllocsFixes.PersistentData.Player.SetOffline () [0x00000] in <filename unknown>:0

2014.09.21 17:46:31: at AllocsFixes.AllocsLogFunctions.PlayerDisconnected (.ConnectionManager manager, Int32 _clientId, Boolean _bShutdown) [0x00000] in <filename unknown>:0

2014.09.21 17:46:31: Removing player with id clientId=20, entityId=81126

2014.09.21 17:46:31: Exited thread_CommWriter: cl=20, ch=1

2014.09.21 17:46:31: No objects for the given player ID were deleted 20

2014.09.21 17:46:31: Exited thread_CommWriter: cl=20, ch=2

2014.09.21 17:46:31: Player set to offline: 76561198028067473

2014.09.21 17:46:31: Error getting entity player for ClientInfo: System.NullReferenceException: Object reference not set to an instance of an object

2014.09.21 17:46:31: at AllocsFixes.CommonMappingFunctions.GetEntityPlayer (.ClientInfo _ci) [0x00000] in <filename unknown>:0

2014.09.21 17:46:31: Error in AllocsLogFunctions.PlayerDisconnected: System.NullReferenceException: Object reference not set to an instance of an object

2014.09.21 17:46:31: at AllocsFixes.PersistentData.Player.SetOffline () [0x00000] in <filename unknown>:0

 

and many of these in the log

(Filename: /BuildAgent/work/d63dfc6385190b60/artifacts/LinuxStandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)
Link to comment
Share on other sites

The latter one is just Unity output for log messages, just ignore them (that's why I filter them for the log, they just clutter it).

 

The first one is a bit weird as that shouldn't be possible but on the other hand the worst that can happen is that the player will still be shown as online in the map atm.

Do you know on what occasion that happened? I.e. was it a normal client side disconnect, a kick by EAC, a kick by console, ban ...?

Link to comment
Share on other sites

i dunno i'll check later

 

can you add some sort of /butcher to remove all zombies.. notice a lot get spawned in stupid places like apartment buildings 4+ stories high or in caves when the nearest player is blocks away and at ground level, doesn't make sense especially when pathfinding ain't excatly great.. seem like simple performance fixes that could go a long way just aren't being done.. so a quick fix to wipe them would help.

 

Just kind of wondering why there is a spike in cpu usage lately with this newer 9.3hotfix when in pre 9.2 had much more players online and less cpu usage.

Link to comment
Share on other sites

i dunno i'll check later

If you do that with a newer mod release instead of looking for the exception please look for "Entity not available. Something seems to be wrong here..." ;)

(Upload in a few minutes)

 

can you add some sort of /butcher to remove all zombies..

Hm, not sure how to do this, will have a look though.

Link to comment
Share on other sites

Hello. Trying to get my server running, but when im running the script, as root, i get this error just after useradd and group add..

 

Downloading and installing management scripts

 

2014-09-22 19:07:42 URL:http://illy.bz/fi/7dtd/management_scripts.tar.gz [918249/918249] -> "/tmp/management_scripts.tar.gz" [1]

update-rc.d: using dependency based boot sequencing

insserv: Script teamspeak is broken: incomplete LSB comment.

insserv: missing `Provides:' entry: please add.

insserv: missing `Required-Start:' entry: please add even if empty.

insserv: missing `Required-Stop:' entry: please add even if empty.

insserv: missing `Default-Start:' entry: please add even if empty.

insserv: missing `Default-Stop:' entry: please add even if empty.

insserv: Default-Start undefined, assuming empty start runlevel(s) for script `teamspeak'

insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `teamspeak'

 

Compiling start-stop-daemon

start-stop-daemon.c:59:25: fatal error: sys/syscall.h: No such file or directory

compilation terminated.

chown: cannot access `start-stop-daemon': No such file or directory

chmod: cannot access `start-stop-daemon': No such file or directory

 

At the end of installation i get a lot of errormessages, and server dont start.. Now what? :/

 

Everything else in the installation is running just fine..

Link to comment
Share on other sites

Compiling fails because you don't have libc6-dev installed (seems to be optional in newer Debian releases). For the other one: Looks like you have a script in /etc/init.d that doesn't meet the requirements for such a script (probably /etc/init.d/teamspeak). Don't know why update-rc.d fails when another script isn't correct but for some reason it does. The only drawback for you could be that the server won't automatically start at boot so you would have to start it manually on each reboot (though maybe update-rc.d does it's job despite the errors).

Link to comment
Share on other sites

Compiling fails because you don't have libc6-dev installed (seems to be optional in newer Debian releases). For the other one: Looks like you have a script in /etc/init.d that doesn't meet the requirements for such a script (probably /etc/init.d/teamspeak). Don't know why update-rc.d fails when another script isn't correct but for some reason it does. The only drawback for you could be that the server won't automatically start at boot so you would have to start it manually on each reboot (though maybe update-rc.d does it's job despite the errors).

 

Thank you. Now the server is running fine.

 

When you mention it, ts3 have never started on boot...

Link to comment
Share on other sites

7dtd.sh start Zone

Instance Zone is already running

 

Only its not.... seems to have somewhat crashed yet still be running... this is making an auto restart cron with " 7dtd.sh start Zone" not that reliable to use..

 

7dtd.sh instances list

Instance name | Running | Players | Port

---------------------+----------+---------+------

/usr/local/lib/7dtd/common.sh: line 186: 25921 Killed nc 127.0. 0.1 $TEL_PORT 0<&3

Zone | yes | 20/25000 | 0

Link to comment
Share on other sites

Only its not.... seems to have somewhat crashed yet still be running... this is making an auto restart cron with " 7dtd.sh start Zone" not that reliable to use..

Well, that's why I wrote that back when you asked:

Well, if it's about real crashes (i.e. process died) <...> . Obviously doesn't work if the process is still running but the server isn't doing what it should.

;)

I.e. you probably just got that case: Server process still running but not doing its job anymore. Currently no way to autodetect this.

Link to comment
Share on other sites

Well, that's why I wrote that back when you asked:

 

;)

I.e. you probably just got that case: Server process still running but not doing its job anymore. Currently no way to autodetect this.

 

what is this "/usr/local/lib/7dtd/common.sh: line 186: 25921 Killed nc 127.0. 0.1 $TEL_PORT 0<&3" bit then.. because that showing up seems to be a good indication its crashed for me.

Link to comment
Share on other sites

what is this "/usr/local/lib/7dtd/common.sh: line 186: 25921 Killed nc 127.0. 0.1 $TEL_PORT 0<&3" bit then.. because that showing up seems to be a good indication its crashed for me.

That's happening whenever the remote end doesn't reply to netcat (used for the network "Telnet" client in the scripts). Wouldn't call this a safe indicator ;)

 

got all this errors after starting server and the hooks aren't working http://pastebin.com/MZdrkqM4

Though sorted out might be interesting for others with the same problem:

Looks like the game uses a lot of file descriptors sometimes and by default a single process in most Linux distros may only open like 1000 files at once. Solution in qriff's post here

Link to comment
Share on other sites

  • 2 weeks later...

As a paranoid Linux Server Admin, I refuse to run strange scripts as root, especially if they download other strange scripts which are also run as root. Instead, I painstakingly ran through all your scripts' actions manually and distilled them down to a short 18 lines that can be run without root access (assuming all prerequisites are installed) and from any installation directory.

 

Would it be alright if I posted the process here for other people who may be as paranoid as I am?

Link to comment
Share on other sites

This does not set up the start script, stop script, or the startstop daemon included in Alloc's official instructions, but it is simple to stop the server with the "shutdown" command from telnet or in game.

 

First step is to ensure you have all the pre-requisites installed and if you're so inclined, have user set up to run the server. These pieces will require root.

 

After navigating to the directory you want the server installed to, here are the steps to get everything up and running:

 

Save the current directory to a variable for referencing later

installdir=$(pwd)

 

Download and extract all the tarballs

wget http://illy.bz/fi/7dtd/linux_files.tar.gz -O - | tar -xzf -
mkdir management_scripts && wget http://illy.bz/fi/7dtd/management_scripts.tar.gz -O - | tar -xzf - -C management_scripts
mkdir steamcmd && wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz -O - | tar -xzf - -C steamcmd

 

Install the dedicated server (put your steam username in place of "loginnamegoeshere")

Steam will ask for your password and, if applicable, your steamguard code.

./steamcmd.sh +quit
./steamcmd.sh +@sSteamCmdForcePlatformType windows +login loginnamegoeshere +force_install_dir $installdir/engine "+app_update 294420" validate +quit

 

Copy the fixes to their correct locations

cd ..
cp -R linux_files/engine/* engine/
cp engine/7DaysToDie_Data/Managed/Assembly-CSharp.dll engine/7DaysToDie_Data/Managed/Assembly-CSharp.dll_orig
cp management_scripts/usr/local/lib/7dtd/server-fixes/* engine/7DaysToDie_Data/Managed/
cp engine/Install/32bit/SteamworksManaged.dll engine/7DaysToDie_Data/Managed/
cp management_scripts/home/sdtd/templates/admins.xml engine/serveradmin.xml

 

Edit the admin and config files, if you want

cd engine
vi serveradmin.xml
vi serverconfig.xml

 

create a directory to put the logs in

mkdir logs

 

start the server

LD_LIBRARY_PATH=$installdir/linux_files LC_ALL=C $installdir/engine/7DaysToDie.x86 -- -logfile $installdir/engine/logs/output_log.txt -configfile=$installdir/engine/serverconfig.xml -dedicated

 

 

P.S. You might want to install tmux, dtach, or screen so you don't tie up your terminal. It's easiest to use one of those to run bash, and then run the command to start the server.

 

- - - Updated - - -

 

Here's the same instructions, just in one long code block instead of broken up with explanations:

installdir=$(pwd)
wget http://illy.bz/fi/7dtd/management_scripts.tar.gz -O - | tar -xf -
wget http://illy.bz/fi/7dtd/linux_files.tar.gz -O - | tar -xf -
mkdir steamcmd
cd steamcmd/
wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz -O - | tar -xf -
./steamcmd.sh +quit
./steamcmd.sh +@sSteamCmdForcePlatformType windows +login loginnamegoeshere +force_install_dir $installdir/engine "+app_update 294420" validate +quit
cd ..
cp -R linux_files/engine/* engine/
cp engine/7DaysToDie_Data/Managed/Assembly-CSharp.dll engine/7DaysToDie_Data/Managed/Assembly-CSharp.dll_orig
cp management_scripts/usr/local/lib/7dtd/server-fixes/* engine/7DaysToDie_Data/Managed/
cp engine/Install/32bit/SteamworksManaged.dll engine/7DaysToDie_Data/Managed/
cp management_scripts/home/sdtd/templates/admins.xml engine/serveradmin.xml
cd engine/
vi serveradmin.xml
vi serverconfig.xml
mkdir logs
LD_LIBRARY_PATH=$installdir/linux_files LC_ALL=C $installdir/engine/7DaysToDie.x86 -- -logfile $installdir/engine/logs/output_log.txt -configfile=$installdir/engine/serverconfig.xml -dedicated

Edited by LeastConcern
OP request (see edit history)
Link to comment
Share on other sites

Running on Ubuntu 14 x64.

Server runs smooth and everything works. But a few times a day the server stops and I have to start it again. A few times it stopped within 60 seconds of starting it, but most the time it just randomly stops about 2-3 times per day.

 

Who knows, it could be my map which I don't really plan on resetting anytime too soon, but my real question is.. is there a way for the server to have some sort of crash detection like FrontRunner has? Even if a script were written utilizing 7dtd.sh status (instance) or even to write one to send the start command every 60 seconds, which would be ignored if it were already running. Suggestions? And FYI, I'm running FrontRunner on my windows 7 pc which connects to the linux server, but of course its crash detection feature can only be used if i were running the server locally on the same host machine.

Link to comment
Share on other sites

Running on Ubuntu 14 x64.

Server runs smooth and everything works. But a few times a day the server stops and I have to start it again. A few times it stopped within 60 seconds of starting it, but most the time it just randomly stops about 2-3 times per day.

 

Last part of this post, and then these: one, two ;)

 

Not sure what exactly FRT was doing but I think he also just checks whether the process still exists. So in that case you will get the same level of detection the way described in those posts.

 

Shouldn't crash that frequently though. Do you run an older save from pre 9.3 era?

Link to comment
Share on other sites

Last part of this post, and then these: one, two ;)

 

Not sure what exactly FRT was doing but I think he also just checks whether the process still exists. So in that case you will get the same level of detection the way described in those posts.

 

Shouldn't crash that frequently though. Do you run an older save from pre 9.3 era?

 

 

 

I'm actually running this map.

http://www.7days2die.ru/threads/uluchshennaja-karta-navezgane-c-71-obektom.447/

 

I'm going to start looking into your references and then amend my comment. TY.

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...