Jump to content

Stopping dedicated server gracefully


Recommended Posts

Hello,

 

I'm hosting a bunch of Linux dedicated servers and I'm wondering if there is a way to shutting down properly a  running server ?

Currently, I'm connecting as client with admin rights to type in console: cl_shutdown(true)

Does dedicated linux server program have an interactive shell while running ?

Perhaps we could send some signals ?

 

Kind regards,

Thyrfen

Link to comment
Share on other sites

Thank you for quick reply.

I use screen like advised in : http://dont-starve-game.wikia.com/wiki/Don%E2%80%99t_Starve_Together_Dedicated_Servers

 

So I get back by screen -x but if I kill it by Ctrl+C it does not save the world in save directory...

The only way to save the world in its current state is to connect a client with admin rights and type cl_shutdown(true).

 

My question is: how to stop gracefully (i.e. saving current state of world) instead of stopping it brutally ?

Link to comment
Share on other sites

@Kuldiin, Yes:

-- Shutdown the application, optionly close with out saving (saves by default)function c_shutdown(save)    if save ~= false and TheWorld ~= nil then        if TheWorld.ismastersim then            for i, v in ipairs(AllPlayers) do                v:OnDespawn()            end            TheSystemService:EnableStorage(true)            SaveGameIndex:SaveCurrent()        else            SerializeUserSession(ThePlayer)        end    end    Shutdown()end 
Link to comment
Share on other sites

@Thyrfen, c_shutdown(). There's the option for dedicated servers to take console commands from their console (on Windows at least). Not sure how that translates to Linux, though.

 

That is exactly what I wanted.

Thank you so much.

And it does work very well on Linux binary.

Link to comment
Share on other sites

Hello,

 

I'm running last version and this command does not work anymore.

Am I the only one experiencing regression ?

 

Best regards,

 

Having the same problem.

c_shutdown() does not respond in any way on Ubuntu 14.04 with steamcmd

Link to comment
Share on other sites

  • Developer

Having the same problem.

c_shutdown() does not respond in any way on Ubuntu 14.04 with steamcmd

 

Are you trying to run the command from in-game or from the console? If in-game, make sure you have admin on that server and the command is run as "remote:". If from the console, the server has to be started with the -console flag for it to accept input.

 

When you run it, what prints to your log?

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