1. How do I run Nexuiz as a service? Right now, I am SSHing into the server and running the server, but when I close the terminal, the Nexuiz server stops. I thought that adding & to the end of the command caused it to be a background running process, but it's still attached to the terminal session because when I close it, the process dies. Do I need to setup a script under /rc/init.d?
There are several possibilities. What we are doing on delight is using the "screen" package, which provides a virtual terminal where you can detach and attach everytime. The start script then looks like
- Code: Select all
nexserv@boron nexserv]$ cat startserver.sh
#!/bin/bash
cd ~/Nexuiz
screen -S NEXUIZ-SERVER -m -d ./nexuiz-dedicated +exec server.cfg +rcon_password `cat ~/.rconpass`
This creates a screen session "NEXUIZ-SERVER" and immediately detaches from it. You can reattach using "screen -r NEXUIZ-SERVER".
The rcon-Password thing allows us to have the rcon-Password in a file named ".rconpass" in the home directory of the user the server is running under. We use this from several scripts for various purposes.
With our setup, the servers don't automatically restart after a system reboot. Someone actually has to log into the box and restart the servers. But since Reboots of the machine are so infrequent, this is currently not a major concern. One possible solution to this would be a cron job which checks for running servers every hour and then restarts them (if you know eggdrop irc bots, the "botchk" script works exactly like this)
2. How do I get the names of the maps to setup the maplist properly....
- Code: Select all
set "g_maplist" "'facing_worlds_nex_b1k''ctf_facing_worlds_nex'"
You need to prefix the game mode to the map, i.e. if the bsp name is "facing_worlds_nex_b1k" and the other "randomexample", use:
- Code: Select all
set "g_maplist" "'ctf_facing_worlds_nex_b1k''ctf_randomexample'"
Sxen