Jump to content

marvin: A simple Linux DST server manager


Recommended Posts

marvin is a simple Don't Starve Together (DST) server manager script for Linux. This is for people who have their own Linux hosts and want to do it themselves.

 

marvin takes the following arguments:

 

  marvin start
  marvin stop
  marvin restart
  marvin status
  marvin update
  marvin update-validate
  marvin console
  marvin setup
 

 

 

You can get it here:

https://github.com/CapitalF/marvin

 

For detailed information, see the README file.

 

marvin makes it easy to get started with a DST server because you don't have to worry about all that garbage of installing SteamCMD, installing the server files, etc etc. It does it all for you, or at least most of it.

 

Have fun.

 

Please post feedback below.

 

Link to comment
Share on other sites

SETUP INSTRUCTIONS

 

This quickie guide should get you started fast.

 

First off, this script is for Linux. Get a terminal/shell handy. I also assume you are using a Debian derivative. CentOS/Fedora and other users are on their own.

 

If you are going to run a DST server, be sure to not put it on any computer that has any private information on it. The likelihood of a remote exploit being discovered is high, and privilege escalation from a local account is easy. Install DST on a dedicated VM/host. Also, don't give this account sudo access.

 

FYI the current definitive guide for setting up a DST server is here, but I'm going to summarize it with my own custom instructions:

http://dont-starve-game.wikia.com/wiki/Guides/Don’t_Starve_Together_Dedicated_Servers

 

DST requires a few libraries to run. Do the following on a 64bit (amd64) Debian/Ubuntu/Mint:

sudo dpkg --add-architecture i386 # Only for amd64sudo apt-get updatesudo apt-get install lib32bcc1 lib32stdc++6 libcurl4-gnutls-dev:i386

WARNING: If you are on Debian stable 7 you will need to install a custom glibc. See the wiki post above for details on that. Blame Klei for this, not me.

 

While you are at it, make sure you have the dependency tools that marvin needs to run:

sudo apt-get install tmux wget lsof sed coreutils grep findutils bsdutils util-linux procps

Download the marvin script and set it executable

wget https://github.com/CapitalF/marvin/raw/master/marvinchmod u+x marvin

Put it in your ~/bin directory. If you don't already have a ~/bin directory, make one, and then make sure it's in your PATH.

 

 

Test marvin and make sure it works:

marvin help

You should get some helper text out. If not, figure out what went wrong and fix it before moving on.

 

Now, run setup:

marvin setup

marvin will tell you what to do via an interactive script. It will look for some basic dependency tools. If it fails, then you need to install the required dependencies, but we should have taken care of that already.

 

Setup will automatically:

Create an installation directory

Install SteamCMD

Download the DST server

Set up a configuration directory

Give you some good advice on other things you need to do.

 

Downloading the installation will take awhile. It's about 430MB in size at the time I write this.

 

 

Some of those "other" things you might want to do include:

 

OPTIONAL: Import the bash auto-complete script if you want it:

wget https://github.com/CapitalF/marvin/raw/master/marvin.bash-autocompletioncat marvin.bash-autocompletion >> ~/.bash_completionsource ~/.bash_completion

OPTIONAL: If you want your server to re-nice the process, add a line for your user in /etc/security/limits.conf like so:

myusername                   -       nice            -10

OPTIONAL: If you want your server to start at system boot time, add an entry to your cron tab (make sure you have a PATH set in your cron tab!):

PATH=$HOME/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin@reboot       ~/bin/marvin start

If you made it this far, then don't worry, we are almost done.

 

 

The DST server won't work correctly without it's main configuration file, which is "settings.ini". marvin, by default, looks for that file in "~/dontstarvetogether/config/settings.ini". The DST doesn't come with an example file, and it won't create one for you, so you've got to make it yourself.

touch ~/dontstarvetogether/config/settings.ini

Now use an editor (vi, emacs, whatever) to config the file. Below is a sample config. Note that comments can be semi-colons ( ; ) or hashes ( # ). It's an ini file, so I use semi-colons, but whatever.

[network]default_server_name = My DST server namedefault_server_description = My DST server descriptionserver_password = potato; server_port = 10999; steam_master_server_port = 27016; steam_authentication_port = 8766max_players = 64pvp = falseenable_vote_kick = truegame_mode = endlessenable_autosaver = truepause_when_empty = true[account]dedicated_lan_server = falseserver_token = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[STEAM]DISABLECLOUD = true[MISC]CONSOLE_ENABLED = true

You see that "server_token" line in the settings.ini file above? That's a key which allows your server to be listed in the public server directory. You need to create one if you want to be listed. If you just want a LAN server, skip this step, delete the server_token line, and set the "dedicated_lan_server" field to be "true" instead of false.

 

To create your server token, you need to open your Don't Starve Together game client and open the console by using the "~" key.

 

On the game client console, type in:

TheNet:GenerateServerToken()

Nothing will happen in the game client, but a "server_token.txt" file will be written to your computer. You need to find this file and open it.

 

On Windows 7 the file should be here (it's in your My Documents folder):

 

C:\Users\USERNAME\Documents\Klei\DoNotStarveTogether\server_token.txt

 

On Linux the file should be here:

 

~/.klei/DoNotStarveTogether/server_token.txt

 

On Mac OS X the file should be here:

 

~/Documents/Klei/DoNotStarveTogether/server_token.txt

 

Once you find that file, copy and paste the string it contains into your settings.ini file as the "server_token" field.  If you read the wiki, forget EVERYTHING it says about copying that stupid server_token.txt file over to the server.

 

 

We are almost done. I SWEAR.

 

 

If you have a firewall, you must configure it to allow inbound connections to the three UDP ports which the DST server uses. By default, those are UDP ports 10999, 27016, and 8766. However, these are completely arbitrary since DST uses a directory system. You can really use any ports you want. I'm not sure how DST on a LAN works though; it probably broadcasts or multicast itself, but I really don't know.

 

 

At this point, you should be ready to start your server for the first time:

marvin start

Wait about 30 seconds and then check on the server process:

marvin status

Now use your game client to check the public server directory list and see if your server appears. If it does, great, if not, yer screwed. Better start troubleshooting.

 

 

If you need to interact with the server console, do:

marvin console

Type "ctrl+b d" to disconnect from the console when done.

 

To stop your server do:

marvin stop

Note that players in the game are given ten seconds of warning before the server goes down. If you want the server to shut down immediately, do a "marvin stopnow" instead.

 

Also note that when the server shuts down, the "c_shutdown(true)" console command is used, so your game state should be saved properly.

 

Finally, when a DST update is released and you need to update your server do this:

marvin update

That's it!

 

Please post corrections and feedback below.

 

Link to comment
Share on other sites

I've tried marvin out on my second dedicated server. It worked great especially because it simplified setup and configuration. I had one issue though: apt commands in the OP did not work.

 

Instead of 

sudo apt-get updatesudo dpkg-add-architecture i386 # Only for amd64 systemssudo apt-get install lib32bcc1 lib32stdc++6 libcurl4-gnutls-dev:i386
 
it should be:
 
sudo dpkg --add-architecture i386 # Only for amd64 systemssudo apt-get updatesudo apt-get install lib32bcc1 lib32stdc++6 libcurl4-gnutls-dev:i386
 
Missing space and dash in "dpkg" command causes architecture not to be added. I also think that apt-get update should be issued _after_ adding an architecture.
 
This caused a shared library to be missing on my system, and marvin was unable to start the server, spamming
failed to connect to serverfailed to connect to serverfailed to connect to serverfailed to connect to serverfailed to connect to serverfailed to connect to server
 
when attempting to issue the 'marvin start' command. 
 
It worked out well after installing the missing library, but the error the marvin prints in such case can be a source of confusion.
 
 
Anyway, great tool, I had my server up and running in minutes. Thumbs up!

 

Link to comment
Share on other sites

 

I've tried marvin out on my second dedicated server. It worked great especially because it simplified setup and configuration. I had one issue though: apt commands in the OP did not work.

 

....

 

 

Thanks for your corrections. I will go fix those issues right now.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...