Multiple Linux Dedicated Servers... Howto posted in the wiki

Post here if you need help setting up your server, etc.
superkikim
On Lightcycle Grid
Posts: 37
Joined: Tue Jan 08, 2008 1:40 pm

Multiple Linux Dedicated Servers... Howto posted in the wiki

Post by superkikim »

--- EDIT 30th July 2008 --------------------------------

SINCE I HAVE POSTED THIS FIRST MESSAGE, I HAVE CREATED A HOWTO ON THE ARMAGETRONAD WIKI:

http://wiki.armagetronad.net/index.php? ... x_computer

-------------------------------------------------------------------------------------


Hi guys,

I need some help here....

1. How can I verify if my dedicated server will restart if the server is rebooted ?

2. How can I run multiple servers on Linux ? I have no clue how to do it.

On windows, I was running multiple instance. But in Linux ? Any help welcome. Could not find anything in the documentation nor on the forum
Last edited by superkikim on Wed Jul 30, 2008 12:29 am, edited 3 times in total.
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Post by epsy »

1. err, reboot the machine? :)

2. ok, do your stuff to get a source copy, ./configure --enable-dedicated( or --no-glout on older versions ) --prefix=/the/dir/where/you/want/arma/to/be
make && make install
make a resource/ directory somewhere, where your server will be able to write

Right, now you have an arma installation
you wont edit anything in there, that will be the part common to all your servers

now, let's make a dir, wherever you want...inside it, two dirs: config/ and var/
let var/ empty, and put your config files (settings_custom.cfg & server_info.cfg) in the config/ folder
then, start arma like this:

Code: Select all

/the/dir/where/you/want/arma/to/be/bin/armagetronad-dedicated --userconfigdir /path/to/config/ --vardir /path/to/var/ --resourcedir /path/to/resource/
User avatar
kyle
Reverse Outside Corner Grinder
Posts: 1963
Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:

Post by kyle »

and to run multiple servers take a look here screen is a good program to use for that. use multiple screens for multiple servers
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

Just as a side note, you can have multiple windows inside of a screen, so technically you could run all of them in one screen session. CTRL-A-C to open a new window and CTRL-A-N to cycle through windows. Wish I knew how to get an app starting to launch into an existing screen creating a new window.
Image
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Post by epsy »

Code: Select all

$ cat ~/.screenrc
screen -t "x server" 0 /home/rain/startserver.php testserver
screen -t "x server logparser" 1 inotail -f /home/rain/testserver/console_log.txt & cat >>/home/rain/testserver/console_input.txt
screen -t "x server TOADMIN log" 2 inotail -f /home/rain/testserver
superkikim
On Lightcycle Grid
Posts: 37
Joined: Tue Jan 08, 2008 1:40 pm

Multiple, like in more than one

Post by superkikim »

Hi folks,

Tx for you replies. I've seen my message and I see I was not really clear in it.

I already run a linux Dedicated server on an FC4 dedicated server hosted remotely. This is the Fast Track Reloaded server.

I have a folder with all my settings there. I used the installer, so I didn't had to work from source files (I was glad, as I'm not a king in Linux). So I didn't do anything, and it just works. I have found that there is an armagetron service installed, and running. I can stop it, restart it. That ok. I know how to do it. The question is more conceptual.

I have a folder with all the settings for Fast Track Reloaded. I know that a second server runs on differnet ports. I made it on windows. The question more: How does it work on linux....

Let's say. I guess I have to create one folder per server, with the setting files inside. Good. Then, how do I tell the Armagetron Service I have many servers to run ?
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

i would suggest building from source. that way, you can have everything in one folder. how did you get the first server? if you got it from your linux system's package installer, get the source for it (i know that on Debian, Ubuntu and other Debian derivatives it is "sudo apt-get source <package>") and build it somewhere else.
Image
Image
Image
superkikim
On Lightcycle Grid
Posts: 37
Joined: Tue Jan 08, 2008 1:40 pm

Post by superkikim »

ivantis wrote:i would suggest building from source. that way, you can have everything in one folder. how did you get the first server? if you got it from your linux system's package installer, get the source for it (i know that on Debian, Ubuntu and other Debian derivatives it is "sudo apt-get source <package>") and build it somewhere else.
Thank you for your suggestion.

But what's next ? once I have rebuild it ?

The package for Debian is great. It installs Arma in a specific folder, but then, you can put the settings in another one. But I don't know the details how it is working.... I can't believe no one knows.
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

If you build form source you would create a new directory for each server and place a var, config directory with the settings, as well as a symlink to the language directory in it and binary. Then you just launch a new server from each directoy. If you want to use the same global install, you can use command line arguments to specify new locations for the config and var directories.

Code: Select all

--configdir <Directory>      : read game configuration (.cfg-files)
                               from this directory
--vardir <Directory>         : save game logs and highscores in this directory
If you want them to all launch automatically with system boot, you'll have to figure out modifications to the system init script for Armagetron yourself.
Image
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

hold on: you could run servers from the same binaries and all, just make other .cfg files for them with unique settings. when you run each server, put the input file to something that says:
INCLUDE <thesettingfile>.cfg

(set input files by putting < after the command and then the path to the file, like "armagetron-server < /path/to/file.cfg")
Image
Image
Image
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

And then you wouldn't be able to collect stats from any of them, or log properly, because they'd all be trying to use the same files...
Image
User avatar
ivantis
Round Winner
Posts: 269
Joined: Mon Mar 03, 2008 2:33 pm
Contact:

Post by ivantis »

oh yeah :lol:
Image
Image
Image
superkikim
On Lightcycle Grid
Posts: 37
Joined: Tue Jan 08, 2008 1:40 pm

It works

Post by superkikim »

Ok, I have managed to do what I wanted with screen

armagetronad-dedicated binary is in /usr/local/bin. This has been installed there by the precompiled armagetronad dedicated package (I'm using Fedora Core 4).

I have a folder dedicated to servers.

In that folder, I create one subfolder per server. Inside this, I make a settings, and a var folder

Code: Select all

/etc/armagetronad-dedicated/server1/settings
/etc/armagetronad-dedicated/server1/var
/etc/armagetronad-dedicated/server2/settings
/etc/armagetronad-dedicated/server2/var
and so on.

Then, I have a script to launch the servers using GNU screen. My script look like:

Code: Select all

screen -dmS %1 /usr/local/bin/armagetronad-dedicated --configdir /etc/armagetronad-dedicated/$1/settings --vardir /etc/armagetronad-dedicated/$1/var
The -dmS parameter creates a new window in detached mode with session name %1 (which is the 1st parameter on the script command line).

I run the script with as parameter the server folder name. This name will be used also as session name for screen:

Code: Select all

./myscript server1
That will then create a new screen session named server1, and will use the config files and the var folder in the server1 folder. Then that's the command I put in my rc.local script (with full path obviously).

Finally, to manage the servers, I just use screen -r which reattach the windows.

Code: Select all

screen -S server1 -r
I'm quite glad with the solution. Hope it helps anyone who was wondering how to easily run multiple servers.
superkikim
On Lightcycle Grid
Posts: 37
Joined: Tue Jan 08, 2008 1:40 pm

Post by superkikim »

Hi all.

I have changed my scripts, and now, I can easily run and manage multiple servers. I have posted an article on the wiki explaining how.

I'm not a king in scripting, but this works pretty well. Hope my scripting is not too dirty.

http://wiki.armagetronad.net/index.php? ... x_computer
User avatar
Lucifer
Project Developer
Posts: 8742
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

Doesn't look too bad. One minor note, though. If you build from a source release, you don't have to run bootstrap.sh, bootstrap.sh is only needed when building from a bzr branch.
Check out my YouTube channel: https://youtube.com/@davefancella?si=H--oCK3k_dQ1laDN

Be the devil's own, Lucifer's my name.
- Iron Maiden
Post Reply