Post here if you need help setting up your server, etc.
dukevin
Round Winner
Posts: 219 Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:
Post
by dukevin » Sun Mar 13, 2011 11:56 am
I have several servers running on Debian OS
The tree looks like this:
Code: Select all
/aa/
|
/bin
/etc
/logs
/scripts
|
start
srv
/servers
|
/server1
/server2
/server3
|
/var
|
<cfg files>
Right now, all the log files for each server are stored in /aa/logs/, but how can I make the logs be stored in /aa/servers/server1/logs/ instead, sorted into individual server directories, as described on
http://wiki.armagetronad.net/index.php? ... x_computer ? Also, if I want to run custom scripts, how can I run them on only 1 of the servers? I'm assuming in server1/scripts but the only /scripts I see are in /aa/scripts and manually creating this directory doesn't seem to work (I think).
AI-team
Shutout Match Winner
Posts: 1020 Joined: Tue Jun 23, 2009 6:17 pm
Location: Germany/Munich
Contact:
Post
by AI-team » Sun Mar 13, 2011 12:31 pm
About the logs:
When starting your server using this script, you can easily define your log/var directories:
Code: Select all
armagetronad-dedicated --vardir var/1/ --configdir cfg/1/
About the scripts:
Assuming you're running sty+ct, start your server like this:
Code: Select all
#!/bin/sh
tron="/path/to/bin/armagetronad-dedicated"
var="/path/to/var/"
log="${var}console_log.txt"
userconfigdir="/path/to/config/"
parser="/path/to/parser.php"
ladderlog="${var}ladderlog.txt"
tail -n0 -f -s 0.01 $ladderlog | $parser | $tron --userconfigdir $userconfigdir --vardir $var | tee -a $log
More information on how to start a sty+ct server:
http://crazy-tronners.com/wiki/index.ph ... g_a_Server
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
dukevin
Round Winner
Posts: 219 Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:
Post
by dukevin » Sun Mar 13, 2011 2:53 pm
AI-team wrote: About the logs:
When starting your server using this script, you can easily define your log/var directories:
Code: Select all
armagetronad-dedicated --vardir var/1/ --configdir cfg/1/
Thanks! Would you mind clarifying though?
do I replace 1 with the name of the server?
Assuming server name is 'server1'
vardir var/server1 --configdir cfg/server1/ ?
AI-team
Shutout Match Winner
Posts: 1020 Joined: Tue Jun 23, 2009 6:17 pm
Location: Germany/Munich
Contact:
Post
by AI-team » Sun Mar 13, 2011 3:19 pm
dukevin wrote: AI-team wrote: About the logs:
When starting your server using this script, you can easily define your log/var directories:
Code: Select all
armagetronad-dedicated --vardir var/1/ --configdir cfg/1/
Thanks! Would you mind clarifying though?
do I replace 1 with the name of the server?
Assuming server name is 'server1'
vardir var/server1 --configdir cfg/server1/ ?
I recommend you to make your tree look like this:
Code: Select all
/aa/
|
/bin
/etc
/logs
/scripts
|
start
srv
/servers
|
/server1
/server2
/server3
|
/cfg
|
<cfg files>
/var
|
<log files>
Based on this tree, the starter-scripts are supposed to look like this:
No scripts involved:
Code: Select all
bin/armagetronad-dedicated --vardir servers/server1/var/ --configdir servers/server1/cfg/
Server running scripts:
Code: Select all
#!/bin/sh
tron="bin/armagetronad-dedicated"
var="server/server1/var/"
log="${var}console_log.txt"
userconfigdir="server/server1/cfg/"
parser="/path/to/parser.php"
ladderlog="${var}ladderlog.txt"
tail -n0 -f -s 0.01 $ladderlog | $parser | $tron --userconfigdir $userconfigdir --vardir $var | tee -a $log
(All these scripts are based on the assumption that you're working in ./aa/)
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
dukevin
Round Winner
Posts: 219 Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:
Post
by dukevin » Mon Mar 14, 2011 10:21 am
Hm, I ran exactly what you wrote while in the ./aa/ dir
and get the output
Code: Select all
vps:/home/duke/aa# bin/armagetronad-dedicated --vardir servers/server1/var/ --configdir servers/server1/cfg/
Error: Error in int main(int, char**) in tron/gArmagetron.cpp:660 :
Configuration files not found. Check your installation.
Prior to running this command, I have made an empty server1/ directory, if that matters.
kyle
Reverse Outside Corner Grinder
Posts: 1975 Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:
Post
by kyle » Mon Mar 14, 2011 1:51 pm
you need the full pat most likely
dukevin
Round Winner
Posts: 219 Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:
Post
by dukevin » Mon Mar 14, 2011 1:56 pm
I tried full paths
Code: Select all
vps:/home/duke/aa# bin/armagetronad-dedicated --vardir home/duke/aa/servers/demo/var/ --configdir home/duke/aa/servers/demo/cfg/
Error: Error in int main(int, char**) in tron/gArmagetron.cpp:660 :
Configuration files not found. Check your installation.
Still no luck
kyle
Reverse Outside Corner Grinder
Posts: 1975 Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:
Post
by kyle » Mon Mar 14, 2011 3:03 pm
use --userconfigdir instead
so
Code: Select all
vps:/home/duke/aa# bin/armagetronad-dedicated --vardir home/duke/aa/servers/demo/var/ --userconfigdir home/duke/aa/servers/demo/cfg/
dukevin
Round Winner
Posts: 219 Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:
Post
by dukevin » Tue Mar 15, 2011 1:57 am
it took it that time, and I see server output.
However, it didn't work.
I manually created /server1/var and /server1/cfg and put settings_custom.cfg and server_info.cfg in server1/cfg (with talk_to_master and all that stuff) and the server wouldn't go online. But, I copyed the cfg's into var and it worked.
What can I do to make it so I can have the cfg's in /cfg?
AI-team
Shutout Match Winner
Posts: 1020 Joined: Tue Jun 23, 2009 6:17 pm
Location: Germany/Munich
Contact:
Post
by AI-team » Tue Mar 15, 2011 1:18 pm
So you're using the script kyle pasted?
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
dukevin
Round Winner
Posts: 219 Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:
Post
by dukevin » Tue Mar 15, 2011 1:32 pm
AI-team wrote: So you're using the script kyle pasted?
Ah, missed that...
Quick, stupid question:
Where does this script go? In aa/scripts/start? Do I replace or append the ./start file?
If so, I'm assuming I have to update this script for every server I want to have logs in a different directory.
AI-team
Shutout Match Winner
Posts: 1020 Joined: Tue Jun 23, 2009 6:17 pm
Location: Germany/Munich
Contact:
Post
by AI-team » Tue Mar 15, 2011 2:30 pm
the above scripts have nothing to do with the serverstarter script, so you need x scripts for x servers.
you might as well want to use this bash script, should be working ( I didn't test it yet).
Code: Select all
#!/bin/sh
#scriptname: "starter.sh"
screen -m -S $1 bin/armagetronad-dedicated --vardir /home/duke/aa/servers/server$1/cfg/ --configdir /home/duke/aa/servers/server$1/cfg/
start your server like this
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
dukevin
Round Winner
Posts: 219 Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:
Post
by dukevin » Tue Mar 15, 2011 11:11 pm
Ah, I'm kind of confused
Do I use your script instead of kyle's or with kyle's?
Also, for kyle's script, do I create a new file for that script and run it?
AI-team
Shutout Match Winner
Posts: 1020 Joined: Tue Jun 23, 2009 6:17 pm
Location: Germany/Munich
Contact:
Post
by AI-team » Tue Mar 15, 2011 11:31 pm
use mine instead of kyle's
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
dukevin
Round Winner
Posts: 219 Joined: Mon Aug 30, 2010 8:25 am
Location: Southern California
Contact:
Post
by dukevin » Wed Mar 16, 2011 3:46 am
AI-team wrote: the above scripts have nothing to do with the serverstarter script, so you need x scripts for x servers.
you might as well want to use this bash script, should be working ( I didn't test it yet).
Code: Select all
#!/bin/sh
#scriptname: "starter.sh"
screen -m -S $1 bin/armagetronad-dedicated --vardir /home/duke/aa/servers/server$1/cfg/ --configdir /home/duke/aa/servers/server$1/cfg/
start your server like this
I don't actually want to call my servers 'server1' or 'server2'
Assuming my server is 'test' (/servers/test/) I created empty directories test/cfg and test/var then ran this
Code: Select all
#!/bin/sh
#scriptname: "starter.sh"
screen -m -S $1 bin/armagetronad-dedicated --vardir /home/duke/aa/servers/test/cfg/ --configdir /home/duke/aa/servers/test/cfg/
Not working, I probably messed something up by calling my server test instead of server1