Jump to content
Sign in to follow this  
benu

Linux server setup howto

Recommended Posts

There are still OFP servers being set up these days and sometimes this seems to cause problems. I hope most of them can be solved with this document.

At first you should go to the Flashnews Board and get the linux server executable. Then you could get the packaging script from Kegetys Site. It creates an archive containg the following files:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">flashpoint.cfg

res/bin/resource.bin

res/bin/ijl15.dll

res/bin/config.bin

res/bin/stringtable.csv

res/addons/abox.pbo

res/addons/apac.pbo

res/addons/bmp2.pbo

res/addons/brmd.pbo

res/addons/flags.pbo

res/addons/g36a.pbo

res/addons/ch47.pbo

res/addons/hunter.pbo

res/addons/kolo.pbo

res/addons/humr.pbo

res/addons/laserguided.pbo

res/addons/kozl.pbo

res/addons/m2a2.pbo

res/addons/mini.pbo

res/addons/mm-1.pbo

res/addons/noe.pbo

res/addons/o.pbo

res/addons/o_wp.pbo

res/addons/oh58.pbo

res/addons/xms.pbo

res/addons/su25.pbo

res/addons/trab.pbo

res/addons/vulcan.pbo

res/addons/6g30.pbo

res/addons/bizon.pbo

res/addons/steyr.pbo

res/dta/data3d.pbo

res/dta/misc.pbo

res/dta/anim.pbo

res/dta/anims.pbo

worlds/abel.wrp

worlds/cain.wrp

worlds/eden.wrp

worlds/intro.wrp

Notice that this package does not contain the res\dta\dta.pbo as Kegetys used a minimal dta.pbo of his own instead. If you don't want to use this you have to pack the dta.pbo too. res\dta\dtaext.pbo (from v1.91+) seems to be missing also. May not be needed though, i am not sure.

Transfer both files to your server and unpack the files archiv. Then copy the server file into your ofp server folder (i will be using /home/ofp in my examples) and run it there:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">gunzip server-1.96.shar.gz

. server-1.96.shar

You may need sharutils and gcc installed for this. What it actually does is unpacking the server executable, unpacking the tolower.c and compiling and then running it. So if you don't have gcc and sharutils installed and can't or do not want to install them you could ask someone to just sent you the server and tolower executalbe (preferrably compiled statically).

After that you have to edit the ofpserver script that came with the server files. You have to change at least one entry, possibly more. OFP_DIR should point to the folder where you unpacked your server. PIDFILE and RUNFILE should look like this (as you will most problably have no write access to /var/run):<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">OFP_DIR =/home/ofp

PIDFILE=${OFP_DIR}/ofp_server.${PORT}.pid

RUNFILE=${OFP_DIR}/ofp_server.${PORT}.run

And maybe insert a line for MODS in the script and change the startup line (at the end of the script) accordingly:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">MODS="mod1;mod2"

${SERVER} >>${LOGFILE} 2>&1 -server -config=${CONFIG} -port=${PORT} -pid=${PIDFILE} -nomap -mod=${MODS}

Edit the server.cfg file to suit your needs (infos for that are found in the DS-Admin.rtf, found eg in the server folder of the resistance cd.

This should be all you need to do, but sadly there are three problems which come up quite often:

1) the server does not start (Segmentation fault)

2) the server does not start and does not generate any output

3) the server starts up but quits at once (Server creation failed : 2302)

The first one seems to stem from your distro using some newer lib versions. You need a set of older libs to start the server. Put those into your ofp folder:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">cd /home/ofp

tar xf libs.tar

and edit the ofpserver script:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">export LD_LIBRARY_PATH=/home/ofp/libs

${SERVER} >>${LOGFILE} 2>&1 -config=${CONFIG} -server -port=${PORT} -pid=${PIDFILE} -nomap -mod=$MODS

if [ -f ${OFP_DIR}/${RUNFILE} ]; then

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

sleep 5s

else

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

fi

unset LD_LIBRARY_PATH

This has been found out by shortylaforge.

The second problem means that most like a needed file is missing. Most probably the flashpoint.cfg. OFP will not start without it.

The third problem can be a little bit more tricky. It has something to do with dns problems and the server name. At first you should make sure your servers hostname only contains alphanumerical characters and does not start with a number. This has been found out by DOA. Also, your external and internal hostname should be the same, ie the output of hostname on the server should be the same as getting the hostname of your ip from an external computer. Found out by HitmannFF. Maybe you have to run the nscd service if it is still not working. You can see some discussion about this in this thread.

EDIT: added the dta.pbo and flashpoint.cfg problem.

Share this post


Link to post
Share on other sites

There may be additional problems when the server is running. On is to start with it with modfolders. If you have more than one you have to put them in quotation marks like this:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">./server -mod="mod1;mod2"For mods that contain .cpp files in the bin folder you may have to copy those into the ofp server root for the mod to work.

The last problem are broken addons. There are varying degrees of "brokenness"... some addons will work in the addons folder but not in a modfolder, some will not work at all. Identifying those addons is not always easy.

If you have a message like "Cannot load mission, missing addons: bis_resistance" (most of the times the addon mentioned is not even used in that mission) in the logs then some addon has broken dependencies. Same goes for clients displaying this message when going into briefing. These are signs of broken dependencies. On clients you only get that message, either as chat text or as popup box you have to click to close and no further problems. On servers these errors will cause missions to stop working.

If you install a new addon and some older missions stop working then this addon is most probably broken. Try to move it the addons folder and retry. If that doesn't help you have to repair it or remove it.

If a mission does not start (ie when selecting it in mission selection you get dumped back to mission selection) you are most probably missing an addon that this mission requires. If an error message about missing addons pops up, most probably you got some broken addons on the server.

Share this post


Link to post
Share on other sites

thought I might ask, were in the config.cpp file is the dependencies? is there any tricks to fixing these addons, I have been repairing a few lately for a server and some of them are a bit weird.

Sometimes the addons don't declare themselves is there a solution to that as well? is it mostly related to the class name linking etc?

Share this post


Link to post
Share on other sites

Thats a bit tricky. I made myself a list of all vehicle and weapon names from the official addons and which addon they depend on, and a list of the addons that get always preloaded.

After that you have to open the addon you suspect of being damaged, try to see if it imports anything from any other addon and if it declares that dependencies correctly. Sometimes it's only ammunition or sounds from other addons that are used but not declared.

Share this post


Link to post
Share on other sites

I think its more of a case of trouble addons using other addon class names so when you load up the game it overwrites and when the mission loads it gets confused resulting in a missing addon error of a addon not even in use in the mission (or of the mission addons).

I think I have the gist of it, just was hoping for some advanced help or guide on this issue.

Share this post


Link to post
Share on other sites

Hm, I just want to know if this problem fits toSuse 9.1 or 9.2, too? I mean the lib problem. Where should the example code be pasted in the ofpserver script?

Der deutsche Link funzt nicht mehr.

THX.

Share this post


Link to post
Share on other sites

As Suse 9.1 and 9.2 are quite new i would guess that they have the libc problem too. It should be quite obvious really once you start the server, either you get a segfault or you don't.

Und die deutsche "Uebersetzung" war eh nicht so prall, hatte ein paar Fehler und war nicht ganz vollstaendig tounge_o.gif

Share this post


Link to post
Share on other sites

Jepp, Suse 9.x has the same problem. Could you help me? Where shall I insert your example code into the ofpserver script. Do I have to fill out anything or can I just copy/paste? I tried once but got some other error message after editing the script.

Danke, Benu.

Share this post


Link to post
Share on other sites

Thank you benu for this tutorial, without you, I would have NEVER been able to install my server by myself!

Share this post


Link to post
Share on other sites

Also running linux server, pretty smooth till now. Lately we are trying running y2k3 on it, but it crashed on seemingly default maps that run no addons at all. Error im getting is Invalid texture aspect ratio (512x32). Anyone read a solution for this cos i dont seem to be able to solve it?

any pointer is greatly appreciated, im running out of options myself. And can someone tell what files i have 2 look for if i wanna read the server logs?

TIA

Screamer =ASP=

Share this post


Link to post
Share on other sites
Also running linux server, pretty smooth till now. Lately we are trying running y2k3 on it, but it crashed on seemingly default maps that run no addons at all. Error im getting is Invalid texture aspect ratio (512x32). Anyone read a solution for this cos i dont seem to be able to solve it?

any pointer is greatly appreciated, im running out of options myself. And can someone tell what files i have 2 look for if i wanna read the server logs?

You won't find any info in the server logs:

Quote[/b] ] 3:56:59 Roles assigned

3:56:59 Reading mission ...

Invalid texture aspect ratio (8x256)

WATCHDOG (6027): [sat Apr 10 03:57:14 CEST 2004] Server died, waiting to restart...

So your best bet is trial and error, ie starting the server with different addons and see when it happens or check all addons that are in the mission.sqm of the mission where it happened.

I am not 100% sure, but as the exact ratio seems to be different on different servers i guess upgrading the graphics hardware might helpt too. Read more about it here.

The only alternative would be to open all addons, check the aspect ratio of all textures and find the "bad" one and either remove the texture or replace it with one with a lower aspect ratio.

Share this post


Link to post
Share on other sites

Tanx again Benu,

Server is running fine with all kinds of addons, only seems to crash with y2k3 addons. Atm we running FCM addon pack without any glitches and we have before ran LOL and VS addon packs on it, also without any problems. So im gonna check the specific Y2K3 addons and see if Pappy B can assist in someway.

Tanx again m8

Share this post


Link to post
Share on other sites

Solution for Invalid texture aspect ratio (512x32) on a Linux server running Y2K3.

Had a talk to admin of spanish clan SSU. They also run Y2K3 on their linux server. Solution for this error is that the INQ_HTTV.pbo has a 512*32 size black texture in it. U can unpbo it and put in a 512*64 size black texture and repbo it. Upload it onto ur server into the Y2K3/ addons dir and overwrite the one thats there. It isnt needed on the clients so dont worry.

Or get the ready made file here ;-)

Linux Adjusted file

Share this post


Link to post
Share on other sites

Nice. D/L now. As the server does not read any textures you could have just deleted it from the pbo too ;)

Share this post


Link to post
Share on other sites

Hia all,

could any1 gimme a pointer on how to auto restart the linux server with different configs. Like im now manually starting 2 diff configs, one with Y2k3 addons and one without it. I checked out some old posts on how to restart server but in those scripts i cannot say what config i want to start.

http://www.flashpoint1985.com/cgi-bin....5;st=45

Also could anyone gimme some info on how to check if a player has a specific file loaded, and if he hasnt he wont be allowed onto the server, like an autokick if someone hasnt loaded up correct adons.

Any input much appreciated as always

Screamer

Share this post


Link to post
Share on other sites
could any1 gimme a pointer on how to auto restart the linux server with different configs. Like im now manually starting 2 diff configs, one with Y2k3 addons and one without it. I checked out some old posts on how to restart server but in those scripts i cannot say what config i want to start.

Why do you want to change the config? Shouldn't changing modfolder be sufficient. But even if you are changing the config you still have to change modfolders too. So depending on how you change modfolders you can change the ofpserver script to either parse a variable or read a config file. Something like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if [[ -r $NEWMODS ]]; then MODS=$(cat $NEWMODS);fi

${SERVER} >>${LOGFILE} 2>&1 -config=${CONFIG} -server -port=${PORT} -pid=${PIDFILE} -nomap -mod=$MODS

Quote[/b] ]Also could anyone gimme some info on how to check if a player has a specific file loaded, and if he hasnt he wont be allowed onto the server, like an autokick if someone hasnt loaded up correct adons.

Not possible with ofp server. Checking is done by putting the path to the config of the addon to be checked into your server config, eg:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">checkfiles[]={"g36a\config.cpp"};

But you can not automatically execute any action depending on the result of this check with the ofp server. You would need some external tools for this.

Share this post


Link to post
Share on other sites
We need the OFP-Linux-Server sources to build them on different kernels, glibc environments. wink_o.gif

Vote for Source! unclesam.gif

I can't find the thread right now, but it's already been requested to get the server source. But since a lot of the client code is tied in there, there's no chance of releasing it...

Edit: Found the thread with Suma's explanation here

Share this post


Link to post
Share on other sites

Hello all, this is my first post here, I appreciate any input!  I am trying to get a OFP Linux server up and running.  I've setup a lot of Q3-based servers in the past and this doesn't look to be anymore difficult than they were.  I am running into the dreaded 2302 error message though.  This is what my startup looks like:

---

[opflash@10 ofp]$ ./server -config=server.cfg -port=2302

18:50:38 Dedicated server created, memory used: 4292 KB

Server creation failed : 2302

[opflash@10 ofp]$

---

DNS on this machine is setup correctly, the hostname is correct when I do reverse lookups, the ptr record is correct on the router at our ISP, it's had over a week to propagate worldwide.  Any other suggestions, other than DNS for the 2302 error message? No firewall on this machine currently, running Red Hat 7.2.

Share this post


Link to post
Share on other sites

Hello all, this is my second post here, and I'm a moron!  Hehehe, I just managed to get past this problem (naturally 10 days after I started working on this server, and 10 minutes after a go to make a post about it).  I fixed it by rereading benu's first post on this issue, just a little slower this time.  Server's hostname started with a number, grrr...

rock.gif

Oh, and benu, I still think I need some help with my configs and stuff, was wondering if you would be willing to assist me? I will gladly pay you for your time.

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  

×