Jump to content

Linux Dedicated Server - Running it and Mods Issue


Recommended Posts

Hi everyone! Thank you in advance for helping me with this issue. I've successfully launched my server (Ubuntu, Linux), my concerns are below:

1. How to log off without disrupting the server?

It won't allow me to do anything once I run/launch the server which is Step 12 on this guide (
Dedicated Server Quick Setup Guide - Linux by Klei Developers)

It says "Sim paused" and just updates when there are users logging into the server, see this example: https://cl.ly/251K211l0c31

I want to be able to log out/shut down without affecting the server since I'm running the terminal via PuttY on my computer. 

2. How to successfully install mods on a dedicated server running on Linux?

Once #1 is solved, I can proceed with installing mods, how do I do this? I tried to follow @ToNiO55's guide but I was stuck. 

Here is my dedicated_server_mods_setup.lua file for my mods folder

Spoiler

--#MovingBox
ServerModSetup("1079538195")

--#FishFarm
ServerModSetup("356435289")

--#InfiniteTentUses
ServerModSetup("356930882")

--#ExtendedIndicatorsWIP
ServerModSetup("358749986")

--#WormholeMarks
ServerModSetup("362175979")

--#IncreasedStackSize
ServerModSetup("374550642")

--#ExtraEquipSlots
ServerModSetup("375850593")

Here is my modoverrides.lua file for both my Caves and Master folder

Spoiler

return {
  ["workshop-1079538195"]={
    configuration_options={
      beebox=true,
      birdcage=true,
      cartographydesk=true,
      cookpot=true,
      dragonflychest=true,
      dragonflyfurnace=true,
      endtable=true,
      firesuppressor=true,
      icebox=true,
      lightning_rod=true,
      meatrack=true,
      modsupport=false,
      moondial=true,
      mushroom_farm=true,
      mushroom_light=true,
      nightlight=true,
      perdshrine=true,
      pottedfern=true,
      rainometer=true,
      researchlab=true,
      researchlab2=true,
      researchlab3=true,
      researchlab4=true,
      resurrectionstatue=true,
      saltlick=true,
      scarecrow=true,
      sculptingtable=true,
      succulent_potted=true,
      townportal=true,
      treasurechest=true,
      wardrobe=true,
      winterometer=true 
    },
    enabled=true 
  },
  ["workshop-356435289"]={ configuration_options={ fishfarmrecipe="easy" }, enabled=true },
  ["workshop-356930882"]={ configuration_options={ uses=10000000, uses2=10000000 }, enabled=true },
  ["workshop-358749986"]={
    configuration_options={ IndicatorSize=4, MaxIndicator=7000, PlayerIndicators=1 },
    enabled=true 
  },
  ["workshop-362175979"]={ configuration_options={ ["Draw over FoW"]="disabled" }, enabled=true },
  ["workshop-374550642"]={ configuration_options={ MAXSTACKSIZE=99 }, enabled=true },
  ["workshop-375850593"]={ configuration_options={  }, enabled=true },
  ["workshop-382177939"]={
    configuration_options={ [""]=true, eightxten="5x16", workit="yep" },
    enabled=true 
  },
  ["workshop-396026892"]={ configuration_options={ OPT_DIFFICULTY=1 }, enabled=true },
  ["workshop-400409675"]={
    configuration_options={ Burnables=1, Effectiveness2=0.05, Hauntables=1, Hunger_Cost=-10, Workables=1 },
    enabled=true 
  },
  ["workshop-439115156"]={
    configuration_options={
      avisual_musha="Bmm",
      avisual_pirate="BL",
      avisual_pirate_armor="pirate",
      avisual_princess="WSP",
      badge_type=2,
      bodyguardwilson=0,
      craftgems="color",
      deathPenalty="on",
      dietmusha="normal",
      difficultdamage="normal",
      difficultdamage_range="normal",
      difficulthealth="normal",
      difficultmusic="dmusic_normal",
      difficultover="monster1x",
      difficultrecipe="normal",
      difficultsanity="normal",
      difficultsleep="dsleep_normal",
      difficulttired="dtired_normal",
      favoritemusha="normal",
      frostblade3rd=1,
      incontainer=0,
      key=108,
      key10=110,
      key11=103,
      key12=116,
      key13=282,
      key14=283,
      key15=111,
      key2=114,
      key3=99,
      key4=120,
      key5=107,
      key6=122,
      key7=112,
      key8=118,
      key9=98,
      loudlightning="off",
      musha_incontainer=1,
      on_butterfly_shield=1,
      princess_taste="princess",
      shareitems=0,
      smartmusha="normal",
      stop_spawning=1 
    },
    enabled=true 
  },
  ["workshop-444235588"]={
    configuration_options={
      deluxeEndoFirepitBurnRate=0.75,
      deluxeFirepitBurnRate=0.75,
      dropLoot="yes",
      endoDropLoot="yes",
      heatStarBurnRate=0.9,
      heatStarDropLoot="yes",
      iceStarBurnRate=0.9,
      iceStarDropLoot="yes",
      recipeCost="standard",
      starsSpawnHounds="no" 
    },
    enabled=true 
  },
  ["workshop-458587300"]={ configuration_options={ Ownership=false, Travel_Cost=32 }, enabled=true } 
}

 

When you log out you don't disrupt or stop the server. The "sim paused" only indicates that the server stopped keeping world progressing or simulating while it's empty. It still continues to run and will continue progressing the world as soon as someone logs in. If this wouldn't be a case a dedicated server with noone playing would just count the day up and a fresh map could already say world day 3074 for the first player logging in after a while. (Unless that's your intention)

Your mods setup looks correct so far. Keep in mind that if you run mods and keep their default configs you don't need to add the configuration options, which can clean up your modoverrides.lua. Did you already try these mod setups and they didn't work, or did you just want to have someone check if they are correct beforehand. (Just asking before I start searching for any issues without knowing if there is any.)

As an example, with most default configs (I haven't checked if you just kept the default ones, or if you changed them) it would look like this: (You can just leave the "configuration_options { }" away as well, saves space. You can also mix and match the ones you want to modify and the ones you want to keep default as you wish, as you can see in this example. These configuration options only override the values you add and keep the rest default.)

return {
  ["workshop-1079538195"]={
    configuration_options={
      beebox=true,
      birdcage=true,
      cartographydesk=true,
      cookpot=true,
      dragonflychest=true,
	},
    enabled=true 
  },
  ["workshop-356435289"]={ configuration_options={ fishfarmrecipe="easy" }, enabled=true },
  ["workshop-356930882"]={ configuration_options={ uses=10000000, uses2=10000000 }, enabled=true },
  ["workshop-358749986"]={ enabled=true },
  ["workshop-362175979"]={ enabled=true },
  ["workshop-374550642"]={ enabled=true },
  ["workshop-375850593"]={ enabled=true },
  ["workshop-382177939"]={ enabled=true },
  ["workshop-396026892"]={ configuration_options={ OPT_DIFFICULTY=1 }, enabled=true },
  ["workshop-400409675"]={ enabled=true },
  ["workshop-439115156"]={ enabled=true },
  ["workshop-444235588"]={ enabled=true },
  ["workshop-458587300"]={ enabled=true } 
} 

Keep in mind, this is just a small example configuration, and will probably not be the exact configuration variant you want to have. It's just as a visual representation of what you can do.

12 hours ago, Daniel86268 said:

When you log out you don't disrupt or stop the server. The "sim paused" only indicates that the server stopped keeping world progressing or simulating while it's empty. It still continues to run and will continue progressing the world as soon as someone logs in. If this wouldn't be a case a dedicated server with noone playing would just count the day up and a fresh map could already say world day 3074 for the first player logging in after a while. (Unless that's your intention)

Your mods setup looks correct so far. Keep in mind that if you run mods and keep their default configs you don't need to add the configuration options, which can clean up your modoverrides.lua. Did you already try these mod setups and they didn't work, or did you just want to have someone check if they are correct beforehand. (Just asking before I start searching for any issues without knowing if there is any.)

As an example, with most default configs (I haven't checked if you just kept the default ones, or if you changed them) it would look like this: (You can just leave the "configuration_options { }" away as well, saves space. You can also mix and match the ones you want to modify and the ones you want to keep default as you wish, as you can see in this example. These configuration options only override the values you add and keep the rest default.)


return {
  ["workshop-1079538195"]={
    configuration_options={
      beebox=true,
      birdcage=true,
      cartographydesk=true,
      cookpot=true,
      dragonflychest=true,
	},
    enabled=true 
  },
  ["workshop-356435289"]={ configuration_options={ fishfarmrecipe="easy" }, enabled=true },
  ["workshop-356930882"]={ configuration_options={ uses=10000000, uses2=10000000 }, enabled=true },
  ["workshop-358749986"]={ enabled=true },
  ["workshop-362175979"]={ enabled=true },
  ["workshop-374550642"]={ enabled=true },
  ["workshop-375850593"]={ enabled=true },
  ["workshop-382177939"]={ enabled=true },
  ["workshop-396026892"]={ configuration_options={ OPT_DIFFICULTY=1 }, enabled=true },
  ["workshop-400409675"]={ enabled=true },
  ["workshop-439115156"]={ enabled=true },
  ["workshop-444235588"]={ enabled=true },
  ["workshop-458587300"]={ enabled=true } 
} 

Keep in mind, this is just a small example configuration, and will probably not be the exact configuration variant you want to have. It's just as a visual representation of what you can do.

Thanks @Daniel86268! Unfortunately, nothing still works. Not sure what I'm doing wrong :(

8 hours ago, chibisesa said:

How do I stop the server and restart it again? I feel like this might be the solution. Since I've saved all my mod files, everything looks correct but it's still not showing on the actual server.

Didn't work, I typed in "c_shutdown()" as admin on the server in-game, it dc'd me, I ran "~/run_dedicated_servers.sh" on the PuttY terminal, it successfully brought back the server but it still doesn't reflect the mods :(

12 hours ago, chibisesa said:

Hmmm dedicated_server_mods_setup.lua  seems to be erasing the changes I make to it.

 

Also there's nothing in my ~/Steam/steamapps/ folder except libraryfolders.vdf

Not sure why it erases the changes in your configuration. I'd assume it does that when you do the entire validation of the integrity of the server files before each startup. Aka Steam notices: "Hey, that's not like the original file, let's revert all changes you've made."

Try running the startup script without the update stuff and see if that works. (outcomment the line "./steamcmd.sh [...]")

According to your startup script your DST server install location is "$home/dontstarvetogether_dedicated_server".

You can either use "c_shutdown()" from the ingame console or from the shell window. Keep in mind that you have to issue the command for both Master and Caves individually. The way you are starting up your server atm you have to enter the "c_shutdown()" twice in the console to shut down both Master and Caves.

8 hours ago, Daniel86268 said:

Not sure why it erases the changes in your configuration. I'd assume it does that when you do the entire validation of the integrity of the server files before each startup. Aka Steam notices: "Hey, that's not like the original file, let's revert all changes you've made."

Try running the startup script without the update stuff and see if that works. (outcomment the line "./steamcmd.sh [...]")

According to your startup script your DST server install location is "$home/dontstarvetogether_dedicated_server".

You can either use "c_shutdown()" from the ingame console or from the shell window. Keep in mind that you have to issue the command for both Master and Caves individually. The way you are starting up your server atm you have to enter the "c_shutdown()" twice in the console to shut down both Master and Caves.

I think the problem is that I had to create modoverrides.lua in both the Caves and Master folder, they look like text files instead of lua files :/ 

1 hour ago, chibisesa said:

I think the problem is that I had to create modoverrides.lua in both the Caves and Master folder, they look like text files instead of lua files :/ 

Make sure you set the file endings to be visible. This is an annoying thing of windows. so basicially your files are named modoverrides.lua.txt because windows skips the .txt by default.

34 minutes ago, Daniel86268 said:

Make sure you set the file endings to be visible. This is an annoying thing of windows. so basicially your files are named modoverrides.lua.txt because windows skips the .txt by default.

I have a Linux server :( any help with this?

 

All I did was nano modoverrides.lua then put my coding in

1 minute ago, chibisesa said:

I have a Linux server :( any help with this?

 

All I did was nano modoverrides.lua then put my coding in

Hm, weird, that should work. For nano these files look exactly the same. That's all correct so far. Did you try outcommenting the auto update when starting the server, because that might remove all changes you made to the server.

12 minutes ago, Daniel86268 said:

Hm, weird, that should work. For nano these files look exactly the same. That's all correct so far. Did you try outcommenting the auto update when starting the server, because that might remove all changes you made to the server.

How do I do this?

 

Our server is [Esports-Tickets.com]

52 minutes ago, chibisesa said:

How do I do this?

 

Our server is [Esports-Tickets.com]

Just place a "--" in front of the line beginning with "./steamcmd.sh [...]". (without quotation marks) That way the server doesn't check for an update and it doesn't do an integrity check and possibly reverts changes again.

3 hours ago, chibisesa said:

Mods are installed.

Server runs fine.

The issue now is that the server shuts down by itself? :( So I'll always have to restart it..

That happens when you close the console because by default the session is bound to your shell session. To prevent this from happening I recommend to use screen. Screen is a demon that allows you to run shell sessions without keeping a connection. to use it simply launch your startup shell like this:

screen -s ./<DST startup script.sh>

instead of

./<DST startup script.sh>

Then you can just close the shell session or disconnect the screen session by pressing ctrl + a + d.

To reconnect to a running screen running in the background you can first list all running sessions by entering

screen -ls

and reconnect to a session simply by typing

screen -rx

or, if you want to connect to a specific session

screen -r <session id>

(useful if you have multiple sessions running at the same time)

19 hours ago, Daniel86268 said:

That happens when you close the console because by default the session is bound to your shell session. To prevent this from happening I recommend to use screen. Screen is a demon that allows you to run shell sessions without keeping a connection. to use it simply launch your startup shell like this:


screen -s ./<DST startup script.sh>

instead of


./<DST startup script.sh>

Then you can just close the shell session or disconnect the screen session by pressing ctrl + a + d.

To reconnect to a running screen running in the background you can first list all running sessions by entering


screen -ls

and reconnect to a session simply by typing


screen -rx

or, if you want to connect to a specific session


screen -r <session id>

(useful if you have multiple sessions running at the same time)

I actually did this and followed the instructions from the official Linux guide, see below:

Spoiler

Use the following:


screen -d -m ~/run_dedicated_servers.sh

This will run the shell script in a "detached session". You can additionally give the session a name such that you can easily re-attach it to your terminal later:


screen -S DSTServer -d -m ~/run_dedicated_servers.sh

to re-attach:


screen -d -r DSTServer

The default key-binding to detach from a session without terminating the active server process is Ctrl-a Ctrl-d

It's giving me this error when I type in screen -s ./run_dedicated_server.sh:

Cannot open your terminal '/dev/pts/0' - please check

It gives me the same error when I type in screen -r DSTServer OR screen -rx

Ok - I also used sudo to start a screen but it says that the socket port is already in use which makes sense because when I type in screen -ls, there is already a screen running the server.

 

https://cl.ly/2R321R3C2u0I

1 hour ago, chibisesa said:

The only thing that works is this: 


screen -d -r DSTServer

And when I type it in, it shows me this:

https://cl.ly/3F1c12420L13

That command detaches the Screen session immediately and tries to reattach it right afterwards again. Not sure why you do that instead of just using

screen -s ./<your startup script>

(Which just starts a server session inside screen.)

The error you are getting is because you already have a server running in screen in the background on the same port. Use

screen -rx

to reattach the one in the background and shut it down if necessary using

c_shutdown()

instead of just closing the shell window.

23 hours ago, Daniel86268 said:

That command detaches the Screen session immediately and tries to reattach it right afterwards again. Not sure why you do that instead of just using


screen -s ./<your startup script>

(Which just starts a server session inside screen.)

The error you are getting is because you already have a server running in screen in the background on the same port. Use


screen -rx

to reattach the one in the background and shut it down if necessary using


c_shutdown()

instead of just closing the shell window.

I still can't fix it :(

Hi @chibisesa

do you have try to follow my guide about dedicated server linux?

http://steamcommunity.com/sharedfiles/filedetails/?id=590565473

i have also tested your dedicated_server_mods_setup.lua and your modoverrides.lua on my dedicated server

and it's works perfectly for me:

https://pastebin.com/raw/r4xbnafC

1711061108576287.jpg

are you sure your files for mods are in the good directory?

/home/dontstarvetogether_dedicated_server/mods/dedicated_server_mods_setup.lua

/.klei/DoNotStarveTogether/MyDediServer/Master/modoverrides.lua      

/.klei/DoNotStarveTogether/MyDediServer/Caves/modoverrides.lua    

Here's my dst-start.sh

 #!/bin/bash
install_dir="$HOME/dontstarvetogether_dedicated_server"

cd "$install_dir/bin"

# Start DsT Dedicated Server
echo Starting main world ...
screen -dmS "DST_M" ./dontstarve_dedicated_server_nullrenderer -cluster MyDediServer -shard Master

echo Starting caves ...
screen -dmS "DST_C" ./dontstarve_dedicated_server_nullrenderer -cluster MyDediServer -shard Caves

dst-stop.sh

#!/bin/bash

# Stop DsT Servers
echo "Shutting down caves ..."
screen -S DST_C -p 0 -X stuff "c_shutdown()\n"

echo "Shutting down main server ..."
screen -S DST_M -p 0 -X stuff "c_shutdown()\n"

and dst-update.sh

#!/bin/bash

steamcmd_dir="$HOME/steamcmd"
install_dir="$HOME/dontstarvetogether_dedicated_server"

$steamcmd_dir/steamcmd.sh +force_install_dir "$install_dir" +login anonymous +app_update 343050 +quit

bash scripts that I use to start, stop and update my DST server.

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