Multiple dedicated servers on the same machine...?

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
Renos
Engineer
Engineer
Posts: 3
Joined: 07 Jun 2005 08:21

Multiple dedicated servers on the same machine...?

Post by Renos »

Hi!

I'm already running one OTTD server in dedicated mode on my FreeBSD machine. What I now trying to do, is to have multiple servers on the same machine, serving different maps - scenarios, games starting in different dates, etc. I understand that I can pass the -c command line option to specify a different configuration file. What happens with .openttd directory? The OTTD server will be running under the same user for ease of administration, so the directory will be shared among the OTTD instances. So, I presume that the savefiles will be trushed.

A workaround would be to use FreeBSD Jails to start different instances of the OS and 'jail' OTTD in there, but I was hopping to avoid that, since the Jail comes with extra ~100MBytes of installation!

Anyone else has an idea?
}T{Reme [Q_G]
Route Supervisor
Route Supervisor
Posts: 389
Joined: 04 Feb 2004 23:24
Contact:

Post by }T{Reme [Q_G] »

Shouldnt be any file conflicts, all the data files are opened on read mode. However autosaves could cause problems, when multiple instances attempt to write to the same file.
Siggy not gonna work unless someone allows javascripting...
gregn1972
Engineer
Engineer
Posts: 2
Joined: 27 Jul 2005 21:18
Location: Michigan, USA
Contact:

Mulitiple servers.

Post by gregn1972 »

Why not just put the servers in different directories on the machine ? they will load with separate pids. I run a production and test versions that way and they work fine. I just have separate ports for the two servers.

Greg
Aloysha
Engineer
Engineer
Posts: 26
Joined: 26 May 2005 12:21
Location: Sydney, Australia

Post by Aloysha »

Why not just copy the entire OpenTTD directory to something new?

Or alternatively do something like what I've done at times:

lrwxrwxrwx 1 root root 25 Aug 8 00:16 data -> ../../dists/openttd/data/
-rw-r--r-- 1 games users 100 Aug 13 14:11 hs.dat
lrwxrwxrwx 1 root root 25 Aug 8 00:16 lang -> ../../dists/openttd/lang/
-rw-r--r-- 1 games users 3478 Aug 13 14:11 openttd.cfg
drwxr-xr-x 3 games users 4096 Aug 8 00:20 save
drwxr-xr-x 2 games users 4096 Aug 8 00:20 scenario

(basically you set up a fake directory which has symlinks to data and lang, then call openttd from wherever it actually is)
Cura Internet OpenTTD
Pixel du Rezo
Engineer
Engineer
Posts: 22
Joined: 11 May 2005 09:10
Location: Rueil-Malmaison (IdF, France)

Post by Pixel du Rezo »

I'm also running multiple servers on the same machine.
Currently, 4 are running...
Each one is in a directory, and is launch with his own conf file.

No problem.
Renos
Engineer
Engineer
Posts: 3
Joined: 07 Jun 2005 08:21

Post by Renos »

Thank you all for your prompt replies.

How do you all manage the autosave files? If I'm not mistaken, the .openttd folder is created in user's home directory. So, even if the configuration files are different the .openttd still remains the same. Am I correct?

Renos
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Post by SirkoZ »

Autosave on the dedicated server - it doesn't create and new directory, it just makes 2 new files - server_tmp and client_tmp - either in /ottd or in /ottd/data directory (I haven't run server for a while).

If the server crashes, just copy the server_tmp under /save directory and rename it to server.sav, then load the dedicated server and write in the console "load 2" (without quotes). 2 being the newest save-file. You can see all the saves by typing "list_files" (without the quotes). :wink:
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: Amazon [Bot] and 19 guests