fs_basepath & fs_homepath (was: Re: [cod] install help?)

Joe Brown joe at overdrivepc.com
Tue Jan 20 09:32:24 EST 2004

Here's how I go about managing mutiple servers on one box, HTH:

Install cod (to an fs_basepath) /usr/games/cod

+set fs_basepath /usr/games/cod

Customized config and other server files are stored in home directories
+set fs_homepath /home/cod1/cod

Install cod/q3/wolfenstien (id based games work like this) and run 
mutiple servers based on one install of the original files and mods via 
fs_basepath specification.  fs_homepath contains only .cfg files 
relavent to any given server.

Contains original install of cod and is also handy to place a public.cfg 
(common sets for all servers) exec it via each server's myconfig.cfg.

Custom configs (myconfig.cfg) placed in 
/home/cod1/cod/main/myconfig.cfg.  Log files etc. will be located in the 

The search order is like this if +set fs_game mod1:

with no mod, it's:

Anything in the fs_homepath overrides the same thing in fs_basepath, 
because the homepath is searched first, so if you need to customize 
something, place it in on servers homepath, of if it needs to be 
customized for all servers then place it in the basepath.

Recommend one user for each server.

adduser cod1
adduser cod2

Start server forever via start_server.sh in home folder of cod1, cod2 ...
cd $HOME/cod
export PATH=/usr/games/cod:$PATH
while [ 1 ]
 ./cod_lnxded +set dedicated 2 +set net_ip IP +set net_port PORT +set 
fs_basepath /usr/games/cod +set fs_homepath $HOME/cod +exec 
myconfig.cfg  +set map_rotate
----end of file

Here's some helper scripts for root:

To start individual servers, start_server.sh cod1 or start_server.sh 
su -l $1 -c "screen -m -d /bin/bash ./start_server.sh"
----end of file

To start all servers after a reboot run ./start_all_servers.sh
/root/bin/start_server.sh cod1
/root/bin/start_server.sh cod2
----end of file

Manging mutiple servers is fairly easy via screen running under each user.

Once I login as root I type 'w' to find out which (tty) terminal I'm on

[root at cod_server root]# w
07:29:31  up 11 days, 23:06,  1 user,  load average: 0.00, 0.02, 0.06
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT
root     pts/2    adslct22       7:22am  0.00s  0.06s  0.02s  w

This is to allows other users to write to the screen
[root at cod_server root]# chmod 0666 /dev/pts/2

Switch to game server user
[root at cod_server root]# su -l cod1

Connect to the game server
[cod1 at cod_server cod1]$ screen -r

do whatever

[cod1 at cod_server cod1]$ exit

[root at cod_server root]# su -l cod2


More information about the Cod mailing list