Jump to content
Sign in to follow this  
Contra

Running 2 servers on one box (linux)

Recommended Posts

Hello everyone,

I am having trouble running a second server on my dedicated box. I already have one server up and running fine. I cloned the Arma folder and configs over to a new user account, in order to run a second server. I just changed the port, and am trying to run it vanilla (no mods).

the server starts up ok with the script, and shows no errors, but i am unable to find it in multyplayer lobby, and cannot even find it when i connect to the ip (with port).

any ideas on why its not showing up ?

server startup script

#!/bin/bash

#

# armaserver: ArmA 2 Linux Dedicated Server Control Script

# © 2010 BIStudio

# ArmA 2 binary version must be 1.04 or later

#

#=======================================================================

#======== CONFIGURATION PARAMETERS ========

#======== MUST BE EDITED MANUALLY TO FIT YOUR SYSTEM PARAMETERS ========

#=======================================================================

ARMA_DIR=/home/armaserver2/server/arma2co

CONFIG=../configs/rggserver.cfg #Relative to server binary!!!

BE_DIR=/home/armaserver2/server/battleye/

PROFILES_DIR=../configs #doesn't work

PROFILE=prserver

PORT=2305

MOD=

PIDFILE=${ARMA_DIR}/${PORT}.pid

RUNFILE=${ARMA_DIR}/${PORT}.run

LOGFILE=${ARMA_DIR}/log.${PORT}.txt

SERVER=${ARMA_DIR}/a2oaserver

OTHERPARAMS="-mod=expansion\beta;expansion\beta\expansion -cpucount=4 -maxmem=2048"

#=======================================================================

ulimit -c 1000000

case "$1" in

start)

if [ -f ${RUNFILE} ]; then

$0 stop

fi

echo "Starting ArmA 2 server..."

# file to mark we want server running...

echo "go" >${RUNFILE}

# launch the background watchdog process to run the server

nohup </dev/null >/dev/null $0 watchdog &

;;

stop)

echo "Stopping ArmA 2 server..."

if [ -f ${RUNFILE} ]; then

# ask watcher process to exit by deleting its runfile...

rm -f ${RUNFILE}

fi

# and terminate ArmA 2 server process

if [ -f ${PIDFILE} ]; then

kill -TERM $(< ${PIDFILE})

if [ -f ${PIDFILE} ]; then

rm -f ${PIDFILE}

fi

fi

;;

status)

if [ -f ${RUNFILE} ]; then

echo "Server should be running..."

else

echo "Server should not be running..."

fi

if [ -f ${PIDFILE} ]; then

PID=$(< ${PIDFILE})

echo "PID file exists (PID=${PID})..."

if [ -f /proc/${PID}/cmdline ]; then

echo "Server process seems to be running..."

fi

fi

;;

check)

echo -n "ArmA 2 directory: ${ARMA_DIR} "

if [ -d ${ARMA_DIR} ]; then

echo "OK"

else

echo "MISSING!"

fi

echo -n "Server executable: ${SERVER} "

if [ -x ${SERVER} ]; then

echo "OK"

else

echo "ERROR!"

fi

echo "Port number: ${PORT}"

echo -n "Config file: ${CONFIG} "

if [ -f ${CONFIG} ]; then

echo "OK"

else

echo "MISSING!"

fi

echo "PID file: ${PIDFILE}"

echo "RUN file: ${RUNFILE}"

;;

restart)

$0 stop

$0 start

;;

watchdog)

# this is a background watchdog process. Do not start directly

while [ -f ${RUNFILE} ]; do

# launch the server...

cd ${ARMA_DIR}

echo >>${LOGFILE} "WATCHDOG ($$): [$(date)] Starting server (port ${PORT})..."

${SERVER} >>${LOGFILE} 2>&1 -server -config=${CONFIG} -port=${PORT} -pid=${PIDFILE} -bepath=${BE_DIR} -profiles=${PROFILES_DIR} -name=${PROFILE} -mod=${MOD} ${OTHERPARAMS}

if [ -f ${RUNFILE} ]; then

echo >>${LOGFILE} "WATCHDOG ($$): [$(date)] Server died, waiting to restart..."

sleep 5s

else

echo >>${LOGFILE} "WATCHDOG ($$): [$(date)] Server shutdown intentional, watchdog terminating"

fi

done

;;

*)

echo "$0 (start|stop|restart|status|check)"

;;

esac

server.cfg

// This is a recommended server config for PR ArmA2 0.15 BETA

//

// GLOBAL SETTINGS

hostname="[RGG] rggprclan.com - Training server"; // replace MyCommunity with your specifics and do not remove the [@PR 0.15] filter

password=""; // Ensure server is passworded until release time (18:00 PRT/UTC Friday 16th April)

passwordAdmin="******"; // Change as required

reportingIP="arma2oapc.master.gamespy.com";

logFile="server_console.log";

maxPlayers=100; // All PR missions are 50v50

Kickduplicate=0;

// WELCOME MESSAGE - Change as required

motd[]={

"Welcome to the RGG PR Server",

"Join our Teamspeak",

"85.25.99.104",

"or visit our forums",

"http://www.rggprclan.com/rggforum/",

};

motdInterval=1;

// VOTING - RECOMMENDED to allow players to change to smaller mission (if no admin present)

voteMissionPlayers=1;

voteThreshold=0.25;

// INGAME SETTINGS

disableVoN=0;

vonCodecQuality=7;

persistent=0; // MANDATORY - mission ends if all players leave

battlEye=1; // MANDATORY for all PR servers

// equalModRequired=1;

// SCRIPTING ISSUES

// regularCheck="";

// some ArmA specific stuff - signature verification

verifySignatures=2; // MANDATORY - do not set to 0 or 1

onUnsignedData = "kick (_this select 0)";

onHackedData = "kick (_this select 0)";

onDifferentData = "";

// JOINING RULES

checkfiles[]={

};

/*

*********************************************************************

MISSIONS

AAS=Advance & Secure AAD=Attack & Defend CI = Counter Insurgency

T=Tiny S=Small M=Medium L=Large

All missions MUST be set to Mercenary difficulty

or the mission will end

Tiny or Small missions are recommended for seeding/low player counts.

*********************************************************************

*/

class Missions

{

class MPCTF_01// name for the mission, can be anything

{

template = M02CaptureTheFlag.SaraLite;// omit the .pbo suffix

cadetMode = 1;// difficulty 0=veteran 1=cadet

};

class MPCOOP_01

{

template = M01Cooperative.SaraLite;

cadetMode = 1;

};

class MPCTI_01

{

template = M03ConquerTheIsland.SaraLite;

cadetMode = 1;

};

};

Share this post


Link to post
Share on other sites

are you sure the additional port is not blocked by your firewall?

Share this post


Link to post
Share on other sites

Are path to server binary and cfg correct? Is port different on other server? Is firewall configured properly?

This should go like this

OTHERPARAMS='-mod=expansion\beta;expansion\beta\expansion -cpucount=4 -maxmem=2048'

Do ./arma2oaserver check and see what it tells you. Or ./a2oaserver check in your case.

Share this post


Link to post
Share on other sites

PORT=2305

That won't work. The first server instance uses ports 2302,2303 and 2305. The lowest available port above 2302 for your second server instance would be port 2306. Try that.

(See here: What ports does Arma use? )

Furthermore, to echo what the others have said - make sure your firewall rules are correct.

Edited by Killswitch

Share this post


Link to post
Share on other sites

Is it really necessary to clone the game folder? Why not run the second server directly from the original folder, just change port (and mods) from your working server. You can use same config files too. Remember to give start-script a new name.

Share this post


Link to post
Share on other sites

Alright thank you for all the replies I will check this later tonight and update with the results

Share this post


Link to post
Share on other sites

ok, so it worked, I am seeing the server now in the multyplayer browser.

The problem im having now is the server hangs and I am stuck in waiting for host. I changed the CFG file because i had the default Arma 1 missions. I changed it to the default mp missions for arma 2 from the BIS wikki page, but still no luck.

Any ideas on why this is happening ?

Share this post


Link to post
Share on other sites

Try log in/vote your self as admin, then type #missions. If you get in as admin, it's just a error in your mission cycle.

Share this post


Link to post
Share on other sites
ok, so it worked, I am seeing the server now in the multyplayer browser.

The problem im having now is the server hangs and I am stuck in waiting for host. I changed the CFG file because i had the default Arma 1 missions. I changed it to the default mp missions for arma 2 from the BIS wikki page, but still no luck.

Any ideas on why this is happening ?

Just remove or comment out Class Missions part and then when you connect it will take you to mission selection screen. Log in as admin edit parameters ( if any ) for chosen mission and you're done.

You know it would be much easier if you just post in code tags your config files so we can see what might be wrong. Sometimes small typo can stop complete server from functioning completely.

Share this post


Link to post
Share on other sites

ok ill pull out the missions cycle. And thankyou for all the fast replies.

http://punkindrublic.com/i-have-no-idea-what-im-doing/i-have-no-idea-what-im-doing

my server startup script:

#!/bin/bash
#
# armaserver: ArmA 2 Linux Dedicated Server Control Script
#  (c) 2010 BIStudio
#  ArmA 2 binary version must be 1.04 or later
#

#=======================================================================
#========               CONFIGURATION PARAMETERS                ========
#======== MUST BE EDITED MANUALLY TO FIT YOUR SYSTEM PARAMETERS ========
#=======================================================================
ARMA_DIR=/home/armaserver2/server/arma2co
CONFIG=../configs/rggserver.cfg #Relative to server binary!!!
BE_DIR=/home/armaserver2/server/battleye/
PROFILES_DIR=../configs #doesn't work
PROFILE=prserver
PORT=2310
MOD=
PIDFILE=${ARMA_DIR}/${PORT}.pid
RUNFILE=${ARMA_DIR}/${PORT}.run
LOGFILE=${ARMA_DIR}/log.${PORT}.txt
SERVER=${ARMA_DIR}/a2oaserver
OTHERPARAMS="-mod=expansion\beta;expansion\beta\expansion -cpucount=4 -maxmem=2048"
#=======================================================================
ulimit -c 1000000

case "$1" in


   start)
if [ -f ${RUNFILE} ]; then
    $0 stop
fi
echo "Starting ArmA 2 server..."
# file to mark we want server running...
echo "go" >${RUNFILE}
# launch the background watchdog process to run the server
nohup </dev/null >/dev/null $0 watchdog &
;;

   stop)
echo "Stopping ArmA 2 server..."
if [ -f ${RUNFILE} ]; then
# ask watcher process to exit by deleting its runfile...
    rm -f ${RUNFILE}
fi
# and terminate ArmA 2 server process
if [ -f ${PIDFILE} ]; then
    kill -TERM $(< ${PIDFILE})
    if [ -f ${PIDFILE} ]; then
	rm -f ${PIDFILE}
    fi
fi
;;


   status)
if [ -f ${RUNFILE} ]; then
    echo "Server should be running..."
else
    echo "Server should not be running..."
fi
if [ -f ${PIDFILE} ]; then
    PID=$(< ${PIDFILE})
    echo "PID file exists (PID=${PID})..."
    if [ -f /proc/${PID}/cmdline ]; then
	echo "Server process seems to be running..."
    fi
fi
;;


   check)
echo -n "ArmA 2 directory: ${ARMA_DIR} "
if [ -d ${ARMA_DIR} ]; then
    echo "OK"
else
    echo "MISSING!"
fi

echo -n "Server executable: ${SERVER} "
if [ -x ${SERVER} ]; then
    echo "OK"
else
    echo "ERROR!"
fi

echo "Port number: ${PORT}"

echo -n "Config file: ${CONFIG} "
if [ -f ${CONFIG} ]; then
    echo "OK"
else
    echo "MISSING!"
fi

echo "PID file: ${PIDFILE}"
echo "RUN file: ${RUNFILE}"

;;

   restart)
$0 stop
$0 start
       ;;

   watchdog)
# this is a background watchdog process. Do not start directly
while [ -f ${RUNFILE} ]; do
# launch the server...
    cd ${ARMA_DIR}
    echo >>${LOGFILE} "WATCHDOG ($$): [$(date)] Starting server (port ${PORT})..."
    ${SERVER} >>${LOGFILE} 2>&1 -server -config=${CONFIG} -port=${PORT} -pid=${PIDFILE} -bepath=${BE_DIR} -profiles=${PROFILES_DIR} -name=${PROFILE} -mod=${MOD} ${OTHERPARAMS}
    if [ -f ${RUNFILE} ]; then
	echo >>${LOGFILE} "WATCHDOG ($$): [$(date)] Server died, waiting to restart..."
	sleep 5s
    else
	echo >>${LOGFILE} "WATCHDOG ($$): [$(date)] Server shutdown intentional, watchdog terminating"
    fi
done
;;
   *)
echo "$0 (start|stop|restart|status|check)"
;;
esac

my server.cfg

// This is a recommended server config for PR ArmA2 0.15 BETA
//
// GLOBAL SETTINGS
hostname="[RGG] rggprclan.com - Training server";  //  replace MyCommunity with your specifics and do not remove the [@PR 0.15] filter
password=""; // Ensure server is passworded until release time (18:00 PRT/UTC Friday 16th April)
passwordAdmin="*****"; // Change as required
reportingIP="arma2oapc.master.gamespy.com";
logFile="server_console.log";
maxPlayers=100; // All PR missions are 50v50
Kickduplicate=0;

// WELCOME MESSAGE - Change as required

motd[]={
"Welcome to the RGG PR Server",
"Join our Teamspeak",
"85.25.99.104",
"or visit our forums",
"http://www.rggprclan.com/rggforum/",

};
motdInterval=1;

// VOTING - RECOMMENDED to allow players to change to smaller mission (if no admin present)
voteMissionPlayers=1;
voteThreshold=0.25;

// INGAME SETTINGS
disableVoN=0;
vonCodecQuality=7;
persistent=0; // MANDATORY - mission ends if all players leave
battlEye=1; // MANDATORY for all PR servers
// equalModRequired=1;

// SCRIPTING ISSUES
// regularCheck="";

// some ArmA specific stuff - signature verification
verifySignatures=2; // MANDATORY - do not set to 0 or 1
onUnsignedData = "kick (_this select 0)";
onHackedData = "kick (_this select 0)";
onDifferentData = "";

// JOINING RULES
checkfiles[]={
};


/*
*********************************************************************

MISSIONS

AAS=Advance & Secure   AAD=Attack & Defend   CI = Counter Insurgency
T=Tiny   S=Small   M=Medium   L=Large

All missions MUST be set to Mercenary difficulty
or the mission will end

Tiny or Small missions are recommended for seeding/low player counts.
*********************************************************************
*/

class Missions
{
       class DM_Deathmatch
       {
               template = "MP_Deathmatch.Chernarus";// omit the .pbo suffix
               difficulty = "recruit";// difficulty: recruit, regular, veteran or mercenary (see CfgDifficulties in the main game config)
       };
       class DM_Detector
       {
               template = "MP_Detector.Chernarus";
               difficulty = "regular";
       };
       class Team_TeamDeathmatch
       {
               template = "MP_TeamDeathmatch.Chernarus";
               difficulty = "veteran";
       };
       class COOP_Paradrop
       {
               template = "MP_Paradrop.Chernarus";
               difficulty = "mercenary";
       };
       class CTI_CivilWar
       {
               template = "MP_CivilWar.Chernarus";
               difficulty = "regular";
       };
       class CTI_SuperPowers
       {
               template = "MP_Superpowers.Chernarus";
               difficulty = "regular";
       };
       class CTI_WarWelcome
       {
               template = "MP_WarWelcome.utes";
               difficulty = "regular";
       };
       class CTI_WhenDiplomacyFails
       {
               template = "MP_WhenDiplomacyFails.Chernarus";
               difficulty = "regular";
       };
};

---------- Post added at 08:55 PM ---------- Previous post was at 08:48 PM ----------

ok I pulled the mission cycle and it works fine now, thanks guys I'd be lost without your help.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×