Sty+ct+ap server

Post here if you need help setting up your server, etc.
User avatar
Tannermon11
Average Program
Posts: 86
Joined: Tue Sep 18, 2007 1:11 am

Sty+ct+ap server

Post by Tannermon11 »

So I am not that good with Ubuntu but I needed to use linux in order to run a script on the server.
So I use bzr for this link: https://code.launchpad.net/~armagetrona ... -sty+ct+ap
After that was done I went into the directory and ran
./bootstrap.sh and then initially I had just done ./configure with no arguments since I didn't know that arguments needed to be included on the thing I was reading.
Later on I found out that --enable-dedicated should be included in the configure so I ended up doing that then make and make install.
I actually had used this whole thing: ./configure --enable-dedicated --prefix=${HOME} --disable-useradd --disable-etc --disable-initscripts --enable-automakedefaults
Anyways, after that was done I ended up making a file that would automatically start the server when it was run which had this inside of it:

cd ~/0.2.9-armagetronad-sty+ct+ap
gnome-terminal -e 'sudo /usr/games/armagetronad-dedicated.real'

The server wasn't even the right version, it was the normal vanilla version. I'm not sure what is really going on but I seem to be missing something. If anyone has an idea of this please let me know because as I said I am not that good with linux in general.

User avatar
LittleSteps
Core Dumper
Posts: 157
Joined: Thu Apr 12, 2012 2:30 am

Re: Sty+ct+ap server

Post by LittleSteps »

Tannermon11 wrote:So I am not that good with Ubuntu but I needed to use linux in order to run a script on the server.
So I use bzr for this link: https://code.launchpad.net/~armagetrona ... -sty+ct+ap
After that was done I went into the directory and ran
./bootstrap.sh and then initially I had just done ./configure with no arguments since I didn't know that arguments needed to be included on the thing I was reading.
Later on I found out that --enable-dedicated should be included in the configure so I ended up doing that then make and make install.
I actually had used this whole thing: ./configure --enable-dedicated --prefix=${HOME} --disable-useradd --disable-etc --disable-initscripts --enable-automakedefaults
Anyways, after that was done I ended up making a file that would automatically start the server when it was run which had this inside of it:

cd ~/0.2.9-armagetronad-sty+ct+ap
gnome-terminal -e 'sudo /usr/games/armagetronad-dedicated.real'

The server wasn't even the right version, it was the normal vanilla version. I'm not sure what is really going on but I seem to be missing something. If anyone has an idea of this please let me know because as I said I am not that good with linux in general.
Does sound odd, not sure what went wrong, but I do recommend using or following this wiki page Light has set up.
http://wiki.armagetronad.org/index.php/ ... e_Easy_Way

By default it will make the server sty ct (not ap) but if you use it as a guide, you can just follow it and use sty ct ap instead.

User avatar
Z-Man
God & Project Admin
Posts: 11333
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: Sty+ct+ap server

Post by Z-Man »

Tannermon11 wrote:gnome-terminal -e 'sudo /usr/games/armagetronad-dedicated.real'
Two mistakes there: you're using 'sudo', giving the server root rights. This is generally not a good idea. The default init start scripts give it the rights of a special user that only runs the arma server. The second mistake is that indeed, you're trying to run the official version you must have installed with apt at some earlier point here.
Speaking of default init scripts, the server you observe running is launched by the init scripts that came with the default installation. The easiest way to get rid of it would be to just uninstall arma over apt; 'apt-get remove armagetronad-dedicated' would probably be the right command line.

Then, to actually run your server, do
'make debug'
in the source directory. Then you can launch it with
'./armagetronad-dedicated'
if you're in that directory. The gnome-terminal thing you're trying probably won't work if your script runs at boot time, it won't find the display to connect itself to. It's better to run servers in the 'screen' command. Or use the init scripts (you explicitly disabled them with the --disable-initscripts argument to configure).

And yeah, that wiki page probably does a much better job at telling you what to actually do than my ramblings :)

User avatar
Tannermon11
Average Program
Posts: 86
Joined: Tue Sep 18, 2007 1:11 am

Re: Sty+ct+ap server

Post by Tannermon11 »

Thanks for the responses, I uninstalled the normal version and then did make debug.
This did indeed start the correct version of the server!
I was now trying to get a script to work. Inside everytime.cfg I put the following: spawn_script script.php
The script.php is in the scripts folder however at the beginning of every round this is being outputted in the terminal:

[0] Launching external command './scripts/script.php'...
execve: No such file or directory

[0] script.php : [0] Closing socket bound to *.*.*.*:4534
[0] Command [0] unknown.
[0] script.php : [0] Closing socket bound to *.*.*.*:57835
[0] Command [0] unknown.

Also none of the commands that should be working are.
Last edited by Tannermon11 on Fri Jul 15, 2016 1:49 pm, edited 1 time in total.

User avatar
LittleSteps
Core Dumper
Posts: 157
Joined: Thu Apr 12, 2012 2:30 am

Re: Sty+ct+ap server

Post by LittleSteps »

Tannermon11 wrote:Thanks for the responses, I uninstalled the normal version and then did make debug.
This did indeed start the correct version of the server!
I was now trying to get a script to work. Inside everytime.cfg I put the following: spawn_script script.php
The script.php is in the scripts folder however at the beginning of every match this is being outputted in the terminal:

[0] Launching external command './scripts/script.php'...
execve: No such file or directory

[0] script.php : [0] Closing socket bound to *.*.*.*:4534
[0] Command [0] unknown.
[0] script.php : [0] Closing socket bound to *.*.*.*:57835
[0] Command [0] unknown.

Also none of the commands that should be working are.
Maybe Light might come around and help you more with this, he is good with server script stuff.

Also I would not put spawn_script in everything.cfg, i would just include it in the main configuration file, doesnt need to run once every round.

What is inside script.php though?

Also if you would like to talk to Light, you can message him at http://lightron.org/#Home
Last edited by LittleSteps on Fri Jul 15, 2016 1:49 pm, edited 1 time in total.

User avatar
Tannermon11
Average Program
Posts: 86
Joined: Tue Sep 18, 2007 1:11 am

Re: Sty+ct+ap server

Post by Tannermon11 »

It's just a whole bunch of different commands that I've mostly made. Some dealing with spawning zones while other deal with printing out information. I know it should work because it used to work on another server, but it wasn't a server that I set up.

User avatar
LittleSteps
Core Dumper
Posts: 157
Joined: Thu Apr 12, 2012 2:30 am

Re: Sty+ct+ap server

Post by LittleSteps »

Tannermon11 wrote:It's just a whole bunch of different commands that I've mostly made. Some dealing with spawning zones while other deal with printing out information. I know it should work because it used to work on another server, but it wasn't a server that I set up.

Code: Select all

[0] Launching external command './scripts/script.php'...
execve: No such file or directory
It looks like it can not find the file, are you sure the file is in that location?

User avatar
Tannermon11
Average Program
Posts: 86
Joined: Tue Sep 18, 2007 1:11 am

Re: Sty+ct+ap server

Post by Tannermon11 »

This is the current path to the scripts folder: /home/tanner/0.2.9-armagetronad-sty+ct+ap/scripts which then has script.php inside it
It does seem to be off when I look at it but I don't know why it would set the path wrong by default if the scripts folder is suppose to be where you put scripts :S

Also, was trying to get zthread working and found this thread on here: http://forums3.armagetronad.net/viewtop ... 37#p243337
Was trying to do the wget and then the tar command but it said not in gzip format, tar: error is not recoverable.

User avatar
Light
Reverse Outside Corner Grinder
Posts: 1659
Joined: Thu Oct 20, 2011 2:11 pm

Re: Sty+ct+ap server

Post by Light »

You can install ZThread with the following.

Code: Select all

wget http://lightron.org/resource/ZThread-2.3.2.tar.gz
tar xvzf ZThread-2.3.2.tar.gz

# Enter Dir
cd ZThread-2.3.2

# Fix Config File
CONFIG=$(cat configure | sed 's/\[:space:\]/[[:space:]]/g')
echo "${CONFIG}" > configure

# Configure ZThread
./configure CXXFLAGS="-fpermissive" --prefix=/usr/

# Build & Install
make
make install
Then you are going to need to rebuild the server, making sure to enable it when running your configure. Also, I believe your scripts directory should be inside of whatever you specify your userdatadir as.

Code: Select all

./armagetronad-dedicated --userdatadir '/path/to/datadir/'
Then script.php would go to:

Code: Select all

/path/to/datadir/scripts/script.php
I have scripts that will set up sty+ct for you, if you'd like to use it as a guide. You could probably switch out the bin file and run it with all the other stuff set up by the script, but I haven't tested that.

http://wiki.armagetronad.org/index.php/ ... e_Easy_Way

User avatar
Tannermon11
Average Program
Posts: 86
Joined: Tue Sep 18, 2007 1:11 am

Re: Sty+ct+ap server

Post by Tannermon11 »

It seems whenever I try to do the configure zthread part it ends up saying this:
bash: ./configure: /bin/[[:space:]]h: bad interpreter: No such file or directory

I noticed in the configure file, there is now a whole bunch of lines that have [:space:] in them,
like every line
the configure zthread works without doing these two lines:
CONFIG=$(cat configure | sed 's/\[:space:\]/[[:space:]]/g')
echo "${CONFIG}" > configure

However there is no makefile found for zthread for some reason when I try to do make/make install

Edit: I did see this in the output for the configure though:
checking for correct ltmain.sh version... grep: character class syntax is [[:space:]], not [:space:]
Are those two lines just replacing the 2 [:space:] with [[:space:]] ?

EDIT:
So I managed to get zthread working, however the script still isn't working correctly as it shows this now in the terminal:

[0] Launching external command '/home/tanner/0.2.9-armagetronad-sty+ct+ap/scripts/script.php'...
execve: No such file or directory

That is where script.php is however and I started the server with ./armagetronad-dedicated --userdatadir '/home/tanner/0.2.9-armagetronad-sty+ct+ap'

User avatar
Lucifer
Project Developer & Local Moonshiner
Posts: 8610
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Re: Sty+ct+ap server

Post by Lucifer »

I don't know if the sty branch is organized like this (cue everyone telling me to add the acronyms I don't give a shit about), but the way the main distribution is setup, you should *never* modify the config files that ship with the game. There are two files you should modify, and I'm forgetting the names, but the README discusses it.

The reason is simple: when you install a new version, it'll overwrite your configs if you modified the configs that ship with the game. So there's an easy method to avoid that, you just have to, you know, follow instructions.
Image

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

User avatar
Light
Reverse Outside Corner Grinder
Posts: 1659
Joined: Thu Oct 20, 2011 2:11 pm

Re: Sty+ct+ap server

Post by Light »

Lucifer wrote:I don't know if the sty branch is organized like this (cue everyone telling me to add the acronyms I don't give a shit about), but the way the main distribution is setup, you should *never* modify the config files that ship with the game. There are two files you should modify, and I'm forgetting the names, but the README discusses it.

The reason is simple: when you install a new version, it'll overwrite your configs if you modified the configs that ship with the game. So there's an easy method to avoid that, you just have to, you know, follow instructions.
Usually server_info.cfg and settings_custom.cfg are used, but everytime.cfg is another valid one to edit that is run each round. Basically anything you can put inside your chosen settings directory is okay as it won't get overwritten.

User avatar
Tannermon11
Average Program
Posts: 86
Joined: Tue Sep 18, 2007 1:11 am

Re: Sty+ct+ap server

Post by Tannermon11 »

Do you know why it is saying that it can't find the file even though it is there?

User avatar
Tannermon11
Average Program
Posts: 86
Joined: Tue Sep 18, 2007 1:11 am

Re: Sty+ct+ap server

Post by Tannermon11 »

Ok I had a thought which may be affecting this.I searched in bin but I couldn't find anything with a file name related to php. So I tried to download php 7 using sudo apt-get install php7.0
It installed a php folder that contained a 7.0 folder which then contained a cli, fpm, and mods-available folder all inside /etc/
The shebang at the very top of the file should be the path to a place where the php is located right? I was wondering if it should then be #!/usr/etc/php ? Would this be an issue?

User avatar
Lucifer
Project Developer & Local Moonshiner
Posts: 8610
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Re: Sty+ct+ap server

Post by Lucifer »

Ok, I thought everytime.cfg was named something else. I'm glad Light brought us the light on that. And hopefully we've settled how your config files should be setup.

On your php script: Is it marked executable? In being marked executable, there's a first line you have to have, which armagetron may or may not care about, but it matters for the shell:

#!/usr/bin/env php

(That may be wrong, I just took the standard python line and translated it for php without googling it)

If that's required, and I'm not really sure what arma does with these things, then you need to add it. If arma only successfully executes bash scripts, then you'll need a bash wrapper that invokes the php interpreter directly.

Now would be a really good time for you to post both your everytime.cfg file and also the content of your script. You can censor the stuff in your script that you don't want players to know, we only need to see how it's supposed to run. We can fill in our own BS for loops and stuff to test the body of the script.
Image

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

Post Reply