Tremulous Forum
General => General Discussion => Topic started by: robug on September 25, 2006, 08:10:48 am
-
I have a few questions on running multiple servers....
I would like to run 2 servers, 1 with default map rotation and 1 with the beta maps.
I am using the following nohup script to make sure tremded stays running.
#!/bin/sh
tremdir="/usr/local/games/tremulous"
process=`ps auxw | grep tremded.x86 | grep -v grep | awk '{print $11}'`
if [ -z "$process" ]; then
echo "Couldn't find tremded.x86 running, restarting it."
cd "$tremdir"
nohup ./tremded.x86 +set dedicated 2 +exec server.cfg &
echo ""
fi
This works great for one server....
Can I rename tremded.x86 to somthing different and modify the nohup script to check for it? and ya I know I need to change the net port etc and point it to another server.cfg.
Or is there a better way of doing this altogether.
I would like to have both processes use the same admin.dat but I would like each to have thier own games.log and admin.log. I assume there is a command line switch to define these output files....
Any Ideas anyone?
Thanks
robug
-
2 directories, link the files you want on both servers, and make sure you use different ports for each instance .)
-
I know how we do it on our windows sst box, just have the program installed in multiple directories, and run multiple instances from each seperate directories.
Ex:
SST: /trem
Hosted 1: /Hos1/
Pickle: /pickle/
-
Uh,
./tremded.x86 +exec server0.cfg +set dedicated 2
./tremded.x86 +exec server1.cfg +set dedicated 2
Wouldn't that work? Just have two server configs and reference them both in two executions.
But what do I know? I'm only a 1.5 year linux convert.
-
When I run multiple game servers outta the same installation/directory, I always specify the the IP and port on the command line...
+set net_ip 70.84.61.148 +set net_port 27960
Then use the IP or port in server up script
like so
$process=`ps auxw | grep 70.84.61.148 | grep -v grep | awk '{print $11}'`
Works great
-
Can I rename tremded.x86 to somthing different and modify the nohup script to check for it? and ya I know I need to change the net port etc and point it to another server.cfg.
Yes, just make a copy of tremded.x86 with a different name and adjust your second script accordingly.
I would like to have both processes use the same admin.dat but I would like each to have thier own games.log and admin.log. I assume there is a command line switch to define these output files....
Having two servers share the same admin.dat doesn't work very well. The file is only read at the start of each map but is written to whenever !setlevel or !ban is run. This can lead to some data loss. There is also the remote chance that both servers could try updating the file at the same time and corrupt the file. The only way do do this safely is to disable !ban and !setlevel on one of the servers.
You can set the name of each of these files with the cvars:
g_admin "name_of_admin.dat"
g_adminLog "name_of_admin.log"
g_logFile "name_of_games.log"
-
IMO, admin.dat should be periodically checked, checked before updating with !ban or !setlevel, and temporary files (and maybe advisory file locks) should be used to prevent a situation where data is lost or corrupted (don't want two processes reading/writing and writing to the same file at the same time).
But there's no reason to share logs between servers.