Author Topic: running multiple servers on the same box  (Read 3226 times)

robug

  • Posts: 50
  • Turrets: +0/-0
running multiple servers on the same box
« 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.

Code: [Select]
#!/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

Caveman

  • Guest
running multiple servers on the same box
« Reply #1 on: September 25, 2006, 10:38:56 am »
2 directories, link the files you want on both servers, and make sure you use different ports for each instance .)

Paradox

  • Posts: 2612
  • Turrets: +253/-250
    • Paradox Designs
running multiple servers on the same box
« Reply #2 on: September 25, 2006, 10:56:30 pm »
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/

∧OMG ENTROPY∧

Odin

  • Spam Killer
  • *
  • Posts: 1767
  • Turrets: +113/-204
    • My Website
running multiple servers on the same box
« Reply #3 on: September 25, 2006, 11:08:07 pm »
Uh,
Code: [Select]
./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.

Shafe

  • Posts: 75
  • Turrets: +0/-0
running multiple servers on the same box
« Reply #4 on: September 27, 2006, 02:38:37 am »
When I run multiple game servers outta the same installation/directory, I always specify the the IP and port on the command line...

Code: [Select]

+set net_ip 70.84.61.148 +set net_port 27960


Then use the IP or port in server up script

like so
Code: [Select]

$process=`ps auxw | grep 70.84.61.148 | grep -v grep | awk '{print $11}'`


Works great
URL=http://www.beer-garden.org/bg2/][/URL]

tjw

  • Posts: 210
  • Turrets: +10/-0
Re: running multiple servers on the same box
« Reply #5 on: September 27, 2006, 05:06:46 am »
Quote from: "robug"

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.

Quote from: "robug"

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"

Undeference

  • Tremulous Developers
  • *
  • Posts: 1254
  • Turrets: +122/-45
running multiple servers on the same box
« Reply #6 on: September 28, 2006, 08:37:52 pm »
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.
Need help? Ask intelligently. Please share solutions you find.

Thats what we need, helpful players, not more powerful admins.