Jump to content

Native Linux server (with management scripts)


Alloc

Recommended Posts

Thank you for the quick reply. I will go ahead and give the tutorial another go with as few alterations as possible (except Gentoo) and try to figure out what went wrong with the start-stop daemon step. My end goal is to not use the scripts (I have a list of reasons) but I would like to thank you for providing them to the community. I'll let you know if I encounter any problems with the start-stop daemon I cannot solve. I did not troubleshoot when I last tried since I expected it to not work before I started.

Link to comment
Share on other sites

Well, I redid the entire installation following your guide verbatim with the only exception being I did not add 7dtd.sh to the default run level. I did not run into any errors compiling the start-stop daemon this time. The test instance I created starts with the only reported error being shown when I ran `7dtd.sh instances list` the first time.

 


Instance name        | Running  | Players | Port
---------------------+----------+---------+------
(UNKNOWN) [127.0.0.1] 8081 (sunproxyadmin) : Connection refused
TestInstance         |      yes |    8/25000 |     0

 

Despite that error, I can connect via telnet just fine.

 

Unfortunately, I am still unable to connect as port 25000 is still closed for some reason, even though the server is up and I can run commands on it via telnet. I'm not entirely sure what's up with that but I suspect it may be something specific to my system (yes, I checked my firewall).

 

EDIT: Or not. I changed the ports around and 7dtd still won't open the game port. I switched the telent port and the game port for testing and telnet runs just fine on port 25000 while 7dtd will not open port 8081. Not sure what to make of this.

Edited by SuspiciouslyAbsent (see edit history)
Link to comment
Share on other sites

Well, I redid the entire installation following your guide verbatim with the only exception being I did not add 7dtd.sh to the default run level. I did not run into any errors compiling the start-stop daemon this time. The test instance I created starts with the only reported error being shown when I ran `7dtd.sh instances list` the first time.

 


Instance name        | Running  | Players | Port
---------------------+----------+---------+------
(UNKNOWN) [127.0.0.1] 8081 (sunproxyadmin) : Connection refused
TestInstance         |      yes |    8/25000 |     0

 

Despite that error, I can connect via telnet just fine.

 

Unfortunately, I am still unable to connect as port 25000 is still closed for some reason, even though the server is up and I can run commands on it via telnet. I'm not entirely sure what's up with that but I suspect it may be something specific to my system (yes, I checked my firewall).

 

EDIT: Or not. I changed the ports around and 7dtd still won't open the game port. I switched the telent port and the game port for testing and telnet runs just fine on port 25000 while 7dtd will not open port 8081. Not sure what to make of this.

 

You can look with netstat -l if there is anything else already running on the specific ports.

Do you have a firewall like iptables blocking incoming traffic?

Link to comment
Share on other sites

You can look with netstat -l if there is anything else already running on the specific ports.

Do you have a firewall like iptables blocking incoming traffic?

 

...

(yes, I checked my firewall)

...

 

It's set to effectively accept any packets from the internal LAN anyway. Besides, I would think that swapping the telnet and game ports would reveal something like the firewall blocking inbound connections (except I didn't realize earlier that the game uses UDP and not TCP which would make that last statement not true). Fortunately for me, I must have changed something somewhere along the way and it works. nmap wasn't helpful because it kept probing 25000/tcp and I didn't realize it wasn't probing udp by default as well.

 

Now the only problem I am trying to figure out is how the instances are started via the script that's different from my startdedicated.sh. I did a diff of the '/home/sdtd/engine/' and my '/srv/sevendaysd/server' and they are the same but when I start up my /srv/sevendaysd version, it spits out this:

 

[s_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
[s_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.

...

Fallback handler could not load library /srv/sevendaysd/server/7DaysToDie_Data/Mono/x86/SteamworksNative
Fallback handler could not load library /srv/sevendaysd/server/7DaysToDie_Data/Mono/x86/SteamworksNative
Fallback handler could not load library /srv/sevendaysd/server/7DaysToDie_Data/Mono/x86/SteamworksNative
Fallback handler could not load library /srv/sevendaysd/server/7DaysToDie_Data/Mono/x86/SteamworksNative
Fallback handler could not load library /srv/sevendaysd/server/7DaysToDie_Data/Mono/x86/SteamworksNative
Fallback handler could not load library /srv/sevendaysd/server/7DaysToDie_Data/Mono/x86/SteamworksNative
0.049 Could not initialize the native Steamworks API. This is usually caused by a missing steam_appid.txt file or if the Steam client is not running.

 

I noted that the LD_LIBRARY_PATH is set to the downloaded 'linux_files' directory containing the extra libraries that I didn't know what to do with originally, and the commands passed to an instance when it starts is different than those found in the provided 'startdedicated.bat' and mirrored my 'startdedicated.sh' accordingly. Despite this, I get the above errors. The steamclient.so is located in 'linux_files' which is in the library path so I find it a little odd that it cannot find it.

Link to comment
Share on other sites

Well, I found the solution to my above problem. There was a trailing "\r" at the end of my 'startdedicated.sh' that stopped all the gears from turning because I copied and edited the supplied 'startdedicated.bat'. Now It starts and I can connect, though I get kicked with:

 

Server disconnected you:

Reason: Your account 'SuspiciouslyAbsent' is not activated or no server answer!

 

Hopefully I can find a solution to that in time so I can just edit this post instead of having to triple post.

Link to comment
Share on other sites

Thought I could edit my last post in time to add this. Here's some relevant info from the output_log.txt. It appears once right before I join the server and only when I go to join.

 

Fallback handler could not load library /srv/sevendaysd/server/7DaysToDie_Data/Mono/x86/SteamworksNative
Fallback handler could not load library /srv/sevendaysd/server/7DaysToDie_Data/Mono/x86/SteamworksNative
Fallback handler could not load library /srv/sevendaysd/server/7DaysToDie_Data/Mono/x86/SteamworksNative
Fallback handler could not load library /srv/sevendaysd/server/7DaysToDie_Data/Mono/x86/SteamworksNative
Exception: ServicesGameServer.Initialize failed: SteamInitializeFailed
 at ManagedSteam.ServicesGameServer.Startup (UInt32 ip, UInt16 steamPort, UInt16 gamePort, UInt16 queryPort, ServerMode serverMode, System.String versionString) [0x00000] in <filename unknown>:0
 at ManagedSteam.ServicesGameServer.Initialize (System.Globalization.CultureInfo activeCulture, UInt32 ip, UInt16 steamPort, UInt16 gamePort, UInt16 queryPort, ServerMode serverMode, System.String versionString) [0x00000] in <filename unknown>:0
 at ManagedSteam.ServicesGameServer.Initialize (UInt32 ip, UInt16 steamPort, UInt16 gamePort, UInt16 queryPort, ServerMode serverMode, System.String versionString) [0x00000] in <filename unknown>:0
 at SteamMasterServer.Connect (UnityEngine.MonoBehaviour _mono) [0x00000] in <filename unknown>:0
 at GameManager.ᢵ▒~Y~C () [0x00000] in <filename unknown>:0
 at GameManager.Awake () [0x00000] in <filename unknown>:0

 

EDIT:

 

Solved, I think...

 

I think it has to do with running multiple instances of the server. I had left an instance running from when I did a vanilla install following Alloc's guide. Once I stopped that, I could connect to my server that wasn't using the management scripts.

Edited by SuspiciouslyAbsent
Solved, I think (see edit history)
Link to comment
Share on other sites

I ran the script

/usr/local/bin/7dtd.sh instances updateengine

then created new game instance using new config template, played several minutes and it seems just fine.

 

However, since I'm new to 7dtd itself, I don't know whether the linux_files including "7DaysToDie.x86 engine" have to be updated or not.

As far as I know, the updateengine option updates only the game itself via steamcmd.

So, I re-downloaded and checked the linux_files that Alloc provided. Their timestamp are still 2 weeks ago, so there's no change at the moment.

Does anyone know where to get information about 7DaysToDie.x86? Is that the official one? If so, where can I get the latest build?

 

Anyway, this thread is very helpful. Thanks!

Link to comment
Share on other sites

Regarding Alpha 8.7

The current version of the scripts will work with 8.7. Only things not working right now: Log parsing to get events like player (dis)connect logged etc. Also the two new config options are obviously not yet included in the instance editor. Will release an update for this within the next 12 hours.

 

There's no need to update anything else besides the game, the Linux specific files only change when TFP switch to a newer Unity version.

 

 

Well, from what I experienced it seems to work the same with no changes. Running multiple instances may not work, but I don't know if it did or did not work before.

Did you test it and it did *not* work? Should work, so that would have to be checked :)

 

 

Does anyone know where to get information about 7DaysToDie.x86? Is that the official one? If so, where can I get the latest build?

There's no "official" Linux binaries yet. Those are all provided by me so far and the latest is within the tar-archive linux_files.tar.gz, but that won't update as long as I do not announce so ;)

 

 

Well it does still work after updating the engine, but I guess it will need a script update to configure some of the newer 8.7 server stuff (though not much sadly)

Only things changed AFAIK are the two new options: MaxSpawnedZombies, VACEnabled. Anything else changed?

 

 

 

New dedicated server build

I will also test if the new dedi build runs fine with the current stuff and then switch to using that one. That might take one or two days more though.

 

 

Regards,

Chris

Link to comment
Share on other sites

Only things changed AFAIK are the two new options: MaxSpawnedZombies, VACEnabled. Anything else changed?

 

Didn't seem like a whole lot added for servers :(

 

New dedicated server build

I will also test if the new dedi build runs fine with the current stuff and then switch to using that one. That might take one or two days more though.

 

Maybe they should just hire you to make the dedicated linux builds :D seems like the entire area gets ignored or they don't have enough developers to work on more areas of the game.

Link to comment
Share on other sites

Thank you all for answering such hasty-successive questions. Now that I grasped some part of the situation.

Knowing that, I want to thank you again, Alloc!

...well, I'd hosted a certain zombie MOD server, so I'm accustomed to waiting(nicely) for the devs! :)

Link to comment
Share on other sites

Maybe they should just hire you to make the dedicated linux builds :D seems like the entire area gets ignored or they don't have enough developers to work on more areas of the game.

 

Finally there is no much difference between the Windows and Linux dedicated server. Just the binary is different, which is delievered by Unity.

I think there are issues with the dependencies.

Link to comment
Share on other sites

i've been a day-one user of your scripts and initially only used parts of them in my own linux setup.

 

with 8.7 i finally took the plunge and did a reinstall via the full wiki instructions. and i'm very glad i did! it's seems very polished and well put together: nice countdown when i shutdown, clean XML reader which outputs sane files, self explanatory folder names,... so thanks for all that! i appreciate it.

Link to comment
Share on other sites

i get this error on shutdown (but shutdown still works):

 

# /etc/init.d/7dtd.sh stop

Stopping all instances:

nekapuzer:

Trying to gracefully shutdown...

Waiting for server to shut down...

1/5

2/5

3/5

/usr/local/lib/7dtd/commands/stop.sh: line 52: setAllPlayersOffline: command not found

Done

 

i see that this function is defined in playerlog.sh but i don't see it "imported" (...i'm a bash noob) in stop.sh

Link to comment
Share on other sites

Hi smono,

 

always happy to hear when people like it :)

 

i get this error on shutdown (but shutdown still works):

...

i see that this function is defined in playerlog.sh but i don't see it "imported" (...i'm a bash noob) in stop.sh

Thanks for reporting, missed that one when working on v.25. In v.26 this error is fixed (though it's only cosmetical, it does not do anything bad or wrong ;) ).

 

Regards,

Chris

Link to comment
Share on other sites

First of all: Great work on these server management scripts and Linux support!

 

Is there any news on when the players.xml logging (f.ex. online-status) will be functional again?

Also, my hooks no longer seem to work since upgrading to 8.7, anyone else running into this problem?

Link to comment
Share on other sites

Is there any news on when the players.xml logging (f.ex. online-status) will be functional again?

Also, my hooks no longer seem to work since upgrading to 8.7, anyone else running into this problem?

 

Just uploaded v.25. See the release notes for more info on changes ;)

So, since v.25 logging is working again ;)

Should also fix your hooks, if not we have to check what's causing this for you.

Link to comment
Share on other sites

Oh, well.. something isnt right then :D It was working before 8.7 though.

I created the hooks folder and placed a script for player-connection which I then marked executable (/home/sdtd/hooks/playerConnect/playerConMsg.sh)

#!/bin/sh

. /usr/local/lib/7dtd/common.sh

telnetCommand $1 "say Welcome $4!"

 

Regarding log output, I just created a new instance and even after joining the resulting logfile "2014-07-12_09-44-16_output.log" only contains one line (Starting instance).

Link to comment
Share on other sites

Well I changed the script to use bin/bash

#!/bin/bash

. /usr/local/lib/7dtd/common.sh

telnetCommand $1 "say Welcome $4!"

It still didnt work though :(

 

Also restarted my test-instance, but the log file still only gets created with one line (Instance created) and the players.xml file for logging is still empty after I joined the server :/

Any suggestions? :D

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