Jump to content

Home

Linux Server howto


madrebel

Recommended Posts

Doh! Guess I should do a little reading before I ask questions. Turns out that it doesn't report to the master server if the port number is 28070, so I bumped it to 28080 and it showed up! Now, I couldn't get the seta net_port to work from my server.cfg so I set an optional parameter for my script that will allow you to specify the port of your desire, else it will default to 28070.

 

I'm not much on versioning, but this one will be version 1.0.1 (.1 for the -p option)

 

I know I didn't give you all much time to reply, but thanks anway. Oh, if you're interested in future version of this script or have a wish list, please send me an email to the address listed when you specify -h or --help.

 

Thanks again,

olgrandad

Link to comment
Share on other sites

  • Replies 96
  • Created
  • Last Reply

If you look, most of the servers on the master list are on 28070. Now, there may have been a particular issue with your setup, but using port 28070 (default) by itself doesn't cause the master list problem. Does the in-game master list include servers that are passworded? I haven't taken the time to look. If that's true, then that could be part of your problem. Did you remove the password prior to changing the port by chance?

 

Regarding the script, there's no option for a listen server (+set dedicated 0). It doesn't take into account that someone might be running more than one screen window. It also doesn't provide for auto-restart in the event of a crash. I'm sure all those features can be added. I guess I'm just too direct, because using a script of that size to startup my server when I can just use a command line inside an auto-restart script that's 5 lines long (includes logging) seems like a waste. But, it's whatever works for you. ;)

Link to comment
Share on other sites

Yeah, I've been self-learning BASH scripting, for my job, and went a little haywire:eek:. But it does the trick and maybe it'll help someone out.

 

My password is set and it still shows up on the list and I'm positive I have nothing else running on port 28070. I even opened up a wider range of ports on my firewall to see if there were other communications trying to take place, to no avail. After switching the port, all was well, go figure.

 

In general I have no need for large scripts, I'm more of a minimalist. For that matter, screen is kind of a waste as well, when a nohup and an & would do just as nicely.

 

Anyhow, good chattin with you.

 

olgrandad

Link to comment
Share on other sites

Server Crashes...

 

So I have my duel server up now on FreeBSD (quite a learning experience having rarely used linux... but I did it in only a coupel hours, nice OS) Now the game server is crashing at the rate of ~1x per day. This is just not acceptable because I do not have access to this server when I leave work. It's become a real pain in the ass.

 

Is there a setting on screen or the executable that once the game server crashes it will automatically restart?

Link to comment
Share on other sites

Just a note, I've been running linux servers since Quake2, newest builds of screen are almost the same as original.

 

The easiest way is create the screen FIRST.

 

screen -R jk (jk is now the name of the screen you can resume and moniter realtime)

 

This creates a screen session named jk the capitol R is to FORCE it to make not just resume an existing screen.

 

You have the ability to go back and forth between prompt and the real time feed from your server. In the realtime screen you can issue commands and run it as if from the win32 console.

 

screen -r jk

 

NOTE: if you simply do a screen -R it only makes one screen and this is fine if your going to only run on e screen session (i have three sesions jk cs aq)

 

Also it's the same ctrl a d to detach.

 

Hope this is also helpfull :):fett::jawa :

 

 

 

 

 

Originally posted by Wintrmte

 

Use screen. It is a fantastic utility that will let you reattach to the server session and is more friendly than using &

 

For example, all you have to do to start the server inside screen is:

 

screen -S jedi ./jk2ded <your server arguments>

 

The screen will blank, and the server starts up. At this point:

 

press ctrl+a, then press the d key by it's self. You should see a line that says

 

[screen detached]

 

The server is still running though. You can logout safely at this point.

 

Now, to get back into your running server, all you have to do is log into your box as the user who is running the jk2ded process (that you screen'd)

 

and type:

 

screen -r jedi

 

You should now be in your server. Do the same (ctrl+a, then d) to get back out.

 

Hope this helps.

Link to comment
Share on other sites

The only problem I see with screen, is that it won't automatically restart the server if it crashes.

 

I dont know how big a problem this is, but i have seen my server crash from time to time, and therefore I would like it to start automatically again.

 

So I made a script /usr/bin/jediknight2

which has this line of code:

 

while true; do cd /usr/local/games/jk2/; ./jk2ded +exec server.cfg > /dev/null 2>&1; sleep 1; done &

 

And then I just start it by typing "jediknight2" as user jk

 

Since I cant attach to the server console as one can with screen, does anyone know of a console-program for jk2ded ?

Kinda like "halfd" for Half-Life based servers..

Link to comment
Share on other sites

I run my servers inside of screen AND have auto-restart ability. My scripts look like so:

 

--startjk2--

#!/bin/csh

echo -n "Starting - "

date "+%D %H:%M:%S"

cd /usr/local/games/jk2

screen -d -m ./holdjk2

 

 

--holdjk2--

#!/bin/csh

echo Ok

while 1

date "+%D %H:%M:%S" >> /tmp/jk2_start.log

echo "JK2 Server Started." >> /tmp/jk2_start.log

sh startup.sh

date "+%D %H:%M:%S" >> /tmp/jk2_start.log

echo "JK2 Server crashed, Restarting." >> /tmp/jk2_start.log

sleep 5

end

 

My startup.sh is a standard command line startup. This setup not only uses screen and provides auto-restart, but it also generates a log letting me know how often and when my server has crashed.

Link to comment
Share on other sites

  • 3 weeks later...

Ok I am running Mandrake 8.2,

I had the server running all fine and dandy, then I installed the new Binary 103, now when I start the server I get this,

When it gets to doing the InitGame I get a dump and the error: Segmentation fault.

It started doing this when I put on the new binary, any ideas?

I would like to stay with the current version, IT ran good on 102 just a few bugs.

Link to comment
Share on other sites

Originally posted by sab

Ok I am running Mandrake 8.2,

I had the server running all fine and dandy, then I installed the new Binary 103, now when I start the server I get this,

When it gets to doing the InitGame I get a dump and the error: Segmentation fault.

It started doing this when I put on the new binary, any ideas?

I would like to stay with the current version, IT ran good on 102 just a few bugs.

 

saw this problem addressed in another thread, but don't remember the answer. seems the new patch doesn't work in linux servers. ours had the same problem, so we set it back to v 1.02c until there's a patch for the patch :p

Link to comment
Share on other sites

Most of the time, what is causing the problem is that the 1.03 client patch includes a new .pk3 file--assets2.pk3. You need to patch your client and upload a copy of that file into your server base dir. Without that extra file, you'll get a seg fault every time.

Link to comment
Share on other sites

MatrixCPA

 

Can you post your startup script "startup.sh" or re-link. Link was bad.

 

I just wanted to see it. I am running Linux Ded Server 1.03 seems to be working fine but very interested in the server restartability. ;)

 

Also can anyone tell me how to add a bot once the server is started... i have 4 but if I get lonley ;) ????

 

-skeeeeeeeeeeep

Link to comment
Share on other sites

I have a script I use which is pretty simple. I run this script from the user willum. i call it restart.sh

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

#!/bin/bash

willumpid() {

/usr/sbin/lsof -i UDP:$1 -F '' | cut -f 1-

}

pid=`willumpid 27960`

if [ -z "$pid" ];

then

/home/willum/server.sh

fi

 

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

if the server is down it executes my startup script server.sh

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

#!/bin/sh

 

echo Starting up JK2 dedicated server: CTF

 

cd /home/willum/jk2

 

screen -A -m -d -S JK2 ./jk2ded +set com_hunkmegs 128 +set dedicated 2 +set sv_pure 1 +sets gamestartup \"`date

+"%m-%d-%y %T"`\" +set ttycon 0 +set net_ip 207.19.97.119 +set net_port 27960 +exec jk2ctf.cfg &

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

then i have crontab check every 5 mins if the port is open

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

*/5 * * * * /home/willum/restart.sh

 

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

hope this helps!

 

 

:cool:

Link to comment
Share on other sites

WOW this thread has been a lot of help.. I actually got my linux server up before I located this forum, but now my configs are tweaked a bit better, and that screens command was exactly what I was looking for last night..

 

well as for the question I had when I came here, I just figured it out.. couldn't get autodownload working it was because I had the config wrong..

 

seta cl_allowdownload 1

instead of the correct command

seta sv_allowdownload 1

 

and farther up the thread someone mentioned server specs .... heres mine

 

PIII 800

256 MB RDRAM

20 GB HD

RedHat 7.3

eth0 Internet

4 - T1's (6MB Internet connection)

 

and heres the config I'm running, it might help someone else out... if anyone see's anything in my config that I should change or might improve performance (or options that don't work for jk2) please let me know.. but it's up and running fine at the moment :)

 

//////////////////////////

// Server Information //

//////////////////////////

 

seta g_motd "Welcome to Farslayers Nightmare"

seta sv_hostname "Farslayers-linux v1.03"

set Administrator "Farslayer"

set Email ""

set url ""

set Location "USA"

 

//////////////////////////

// Server Configuration //

//////////////////////////

 

seta g_needpass "0"

seta sv_privatePassword "********"

seta rconpassword "********"

seta sv_maxclients "32"

seta sv_minclients "0"

seta sv_privateClients "1"

seta sv_maxRate "10000"

seta sv_maxping "500"

seta g_ghostRespawn "0"

seta g_forcerespawn "1"

seta g_inactivity "0"

seta g_warmup "0"

seta sv_pure "1"

seta sv_master5 ""

seta sv_master4 ""

seta sv_master3 ""

seta sv_master2 ""

seta sv_master1 "masterjk2.ravensoft.com"

seta g_allowvote "1"

seta sv_allowDownload "1"

seta g_friendlyfire "0"

seta g_teamForceBalance "1"

seta g_teamAutoJoin "1"

seta sv_floodProtect "1"

seta g_duelWeaponDisable "0"

seta g_privateDuel "0"

seta g_friendlySaber "1"

 

//seta g_gravity 800

 

//////////////////////////

// Game Settings //

//////////////////////////

seta fraglimit "0"

seta timelimit "20"

seta capturelimit "5"

 

 

//////////////////////////

// MODE Settings //

//////////////////////////

//

// Set one line for gametype and one for PMOD

//

//Normal CTF is gametype 7

 

seta g_gametype 7

 

 

// Map Stuff

 

 

// Maps for Normal CTF

 

set d1 "map ctf_spaceport ; set nextmap vstr d2"

set d2 "map ctf_imperial ; set nextmap vstr d3"

set d3 "map ctf_ns_streets ; set nextmap vstr d4"

set d4 "map ctf_Yavin ; set nextmap vstr d5"

set d5 "map EchoBaseCTF ; set nextmap vstr d6"

set d6 "map ctf_destroyer ; set nextmap vstr d7"

set d7 "map ctf-massassi ; set nextmap vstr d8"

set d8 "map ctf_bespin ; set nextmap vstr d9"

set d9 "map ctf_tanzin ; set nextmap vstr d1"

vstr d1

 

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

 

I'm relatively new to linux, this is my first attempt at hosting a linux game server, I must say it's not too bad after you start to locate all the information you need. Probably would have helped if I had hosted a Quake server in the past as well no matter what the platform...

 

Thx again.

 

Far...out

Link to comment
Share on other sites

Ok, here's my comments on the config. I've seen a bunch of variations of that one and they all have the same things wrong:

 

Administrator, Email, URL, Connection, Location should all use sets and not seta.

 

I don't believe sv_autoDownload is a valid cvar.

 

You have g_autoMapCycle on, but use a custom rotation. I'd recommend turning it off.

 

Any cvar that starts with cl_, cg_, ui_, r_, or s_ can be ignored for a dedicated server as they don't make any difference. There are a few in your config.

 

Otherwise, it's hard to knock it if it's working. I only make the comments about the client-side cvars because people keep including them needlessly after looking at posted configs that contain them.

Link to comment
Share on other sites

I appreciate the feedback, Like you guessed I pulled the config from around here and modified it, I don't really understand the whole thing yet. but your pointers should help me clean it up a bit and trim it down. Config is Updated, I'll just edit the last post and replace it there for further pointers.. :) seems not too many people play CTF though since the server has been pretty much empty for the last 2 days.. 4-T1's sitting Idle.. 6Mb of bandwidth and no players, how depressing is that ?

 

Far...out

Link to comment
Share on other sites

yeah my CTF server had crashed last night and when i restarted this morning with in 3 minutes I had players and within the hour I had 20+

 

Whats wierd is I personally cant see the server the master-list. but from the traffic it seems other people can. ;)

 

oh and there are some CTF maps that I downloaded that im sure people dont have. Is there a way to get people to download if they dont have them since you say "I don't believe sv_autoDownload is a valid cvar. " ???

 

 

-skeep

Link to comment
Share on other sites

seta sv_allowDownload "1"

 

is the correct option to turn on Map downloading on the server.. I have tested it and it works :)

 

Finally figured it out by going to the server list and viewing options it has the valid ones listed. and it listed allowDownload instead of autodownload I tried it, and it works.

 

Far..out

Link to comment
Share on other sites

okay now next question is how bad do downloads tax the server? I also host UT servers and I know that it pretty much kills it unless you redirect to a different box. In other words should i leave it off? I have a 25 player max set and the network lights are solid when the server is full.

 

-skeep

Link to comment
Share on other sites

Thanks in advance for you help;

 

I've set up and run my jk2 server without a hitch...except one.

 

I'm attempting a Duel/lightsaber-only server, but it always loads up with all the weapons. I've put in the line:

 

seta g_weaponDisable "65531"

 

but it still screws up and loads all the weapons/allows them all.

 

It even says "saber only" when you attempt to connect, but...it just says it.

 

If anyone could help me out, it'd be much appreciated.

Link to comment
Share on other sites

It's helpful, since the search feature is disabled, if you post questions in their own thread with a suitable title so that others with the same question can more readily find it. I'll answer your questions here out of the kindness of my heart. ;)

 

okay now next question is how bad do downloads tax the server? I also host UT servers and I know that it pretty much kills it unless you redirect to a different box. In other words should i leave it off? I have a 25 player max set and the network lights are solid when the server is full.
Well, unlike UT, a JK2 server cannot redirect downloads. However, downloads don't tax the server because the download speed is limited to the sv_maxrate. So, the player downloading a map uses no more bandwidth than a player who is playing. The downside is that it can take FOREVER to download a map this way--especially if the server has a maxrate around 5000-6000. Remember that a maxrate of 5000 is designed to accomodate a 56k user.

 

I'm attempting a Duel/lightsaber-only server, but it always loads up with all the weapons. I've put in the line:

 

seta g_weaponDisable "65531"

 

but it still screws up and loads all the weapons/allows them all.

 

It even says "saber only" when you attempt to connect, but...it just says it.

You need to also use the following in your config:

 

seta g_duelWeaponDisable "65531"

 

There's 2 cvars for disabling weapons, one for duels and one for all other times.

Link to comment
Share on other sites

In the 103a zip it says that you need Assets2.pk3 from the 103 patch... where is that? I'm not sure if that's the problem... but I keep getting seg faults when running the game... I'm new to linux... actually just started using it for this :) ... but it gets all the way to loading the is :

g_weaponDisable\0\g_redteam\Empire\g_blueteam\Rebellion

then it seg faults.

 

I also just noticed that it cant exec autoexec.cfg

Link to comment
Share on other sites

The autoexec.cfg isn't necessary and you can ignore the error. If you really want to get rid of it, just create an empty file with that name and put it in the base directory. Now, as far as the assets2.pk3 file, you need to copy that from a 1.03 patched client. It will be in the gamedata/base directory.

Link to comment
Share on other sites

Got it to works, thanks... for some reason I was missing assets2.pk3... dunno where it went... I got it off someone and now the server runs.

 

And now I have another problem :)

 

It is said the default loads internet play... but for some reason mine doesn't... what's the command for running it in internet mode?

 

Ok well I found out that it does work on the internet it's just that when people attempt to join it stops at awaiting connection... any idea?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...