Page 1 of 1

Save restart of a headless server?

Posted: Sat Mar 19, 2016 10:29 am
by sirmg
Hi,

my headless server is running on a vServer.
The server has his own user : facrorio.

How can i restart the server without losing any data? I once tryed simple #restart as root but there was a data loss in the savegame.
How can i close the server to prevent this?

Re: Save restart of a headless server?

Posted: Mon Mar 21, 2016 12:17 pm
by sirmg
No one have an idea?

Right now the server does not save on the main savegame it uses only the autosave files.
When i now restart the server i must rename a autosave or change the the server start to an autosave file.

So is this a bug? Ore is your how to make make a server tut wrong?

Image

Re: Save restart of a headless server?

Posted: Mon Mar 21, 2016 12:22 pm
by daniel34
If you close the server with CTRL+C or by sending SIGINT to it, it will save the game to the savename it started from and then quit.

Re: Save restart of a headless server?

Posted: Mon Mar 21, 2016 12:56 pm
by sirmg
daniel34 wrote:If you close the server with CTRL+C or by sending SIGINT to it, it will save the game to the savename it started from and then quit.
CTRL+C will not work because its a process. How does SIGINT work? I never heard of it?!

Code: Select all

sudo -u factorio /usr/local/factorio/factorio/bin/x64/./factorio --start-server Neuland.zip
This is how i start the server.

Image

This is the process.

Re: Save restart of a headless server?

Posted: Mon Mar 21, 2016 4:42 pm
by daniel34

Code: Select all

kill -INT $(pidof factorio)
will send the SIGINT signal to the process, making it save the game and then exit.

You can also use Bisa's [linux] Dedicated server init script