Page 1 of 1

Multiple dedicated servers on the same machine...?

Posted: 22 Aug 2005 14:08
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?

Posted: 22 Aug 2005 18:20
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.

Mulitiple servers.

Posted: 23 Aug 2005 02:11
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

Posted: 23 Aug 2005 09:10
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)

Posted: 23 Aug 2005 09:11
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.

Posted: 23 Aug 2005 11:17
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

Posted: 23 Aug 2005 14:32
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: