Help - Search - Members - Calendar
Full Version: Newbie Hlds/ns Linux Server Guide
Unknown Worlds Forums > Natural Selection > Natural Selection Discussion > General Server Discussion > Linux Server Support
Pages: 1, 2, 3
Vadakill
I have a site for my NS Server setup Guides now; I cover Steam servers for NS 2.0 and 3.0, 3.1.1.1d and 3.1.1.0c with Boffix server setups. You can check out the guides on my site:

http://www.vadakill.com/nsguides



GoleX
Nice work Vadakill! This should answer alot of the newbie questions.

Bump and vote for pinning.
Hukka
QUOTE (GoleX @ Nov 11 2002, 02:23 AM)
Nice work Vadakill! This should answer alot of the newbie questions.

Bump and vote for pinning.

I have crazy question.. what if we using two pingbooster system on same time? What would be happen then? smile.gif
GoleX
Pingbooster never helped for me =/
Hukka
QUOTE (GoleX @ Nov 11 2002, 02:35 AM)
Pingbooster never helped for me =/

Use only hlfs own pingboost (set 3) will help you.
Vadakill
Please check the site in my sig for the latest up to date guides involving setting up Metamod and AdminMod.
Phalck
EDITED 13th Nov 2002: See end of post for additions

To add Clanmod to your NS-server is almost as easy as adding adminmod. There are a few things you can do to the configuration files to prevent your admins to try things that are not relevant for NS.

Until VadaKill writes an installation guide for ClanMod I can share the changes that I have made to the configuration files.

Download the generic (not mod specific configs) ClanMod files from www.unitedadmins.com. Also download the NS specific configuration files for ClanMod. You find them in the NS forum on www.unitedadmins.com. Yes! They also have a NS forum! The only real change from the generic configs that I could see at a glance was that the cm_maps.cfg held the correct rows to enable menubased mapchanges.

I will not tell you how to install ClanMod but its pretty straight forward. Here are my changes to the configuration files:

The clanmod.cfg file
CODE

// ---------------------------------------------------------------------------
// ClanMod 1.80.x Natural selection Config Pack v1.80.01 (Oct 1, 2002)
// Visit www.unitedadmins.com for all your ClanMod needs
// Please read the manual carefully before altering this config!
// ---------------------------------------------------------------------------

// ---------------------------------------------------------------------------
// Clears out all commands in ClanMod for fresh start each time config loads
// ---------------------------------------------------------------------------
cm_remove * *

// ---------------------------------------------------------------------------
// Writes into HL Logs
// ---------------------------------------------------------------------------
cm_log "Executing ClanMod configuration file (&cm_configpath&/clanmod.cfg)"

// ---------------------------------------------------------------------------
// ClanMod 1.8 Menu Layout
// ---------------------------------------------------------------------------
cm_menulayout "ABCD1EQ1HLM1J:ING1FOPR1TU"

// ---------------------------------------------------------------------------
// Separate Config Files to Execute
// ---------------------------------------------------------------------------
cm_exec titles.cfg
cm_exec cm_admins.cfg
cm_exec cm_menus.cfg
cm_exec cm_maps.cfg
cm_exec cm_badwords.cfg
cm_exec cm_aliases.cfg
cm_exec cm_cvars.cfg

// ---------------------------------------------------------------------------
// Clanmod Addons, Put a comment in front to remove the addon.
// ---------------------------------------------------------------------------

// Extend map vote
// I dont want to extend maps in NS, the games are long anyways
//cm_exec addons/addon_mapextend.cfg
//cm_addonmapextend 1    // 0 = Disabled, 1 = Enabled

// ---------------------------------------------------------------------------
// ClanMod Cvars
// Please read the manual before changing these
// ---------------------------------------------------------------------------
cm_info www.gobz.nu  //What shows up on the info line when viewing the server with a game browser
cm_passwordfield "_cm_pw"  //This is the default Password Field
cm_loadconfig 0    //0 - Load Config files once, 1 - Load Config files every map change
cm_reservation 1   //The type of reservation system to use. See the manual for details
cm_freeslots 3   // 4 reserved slots for admins (It should be set to 3!).
//cm_times "tv +600 180 120 60 <10" //When the server should publicly announce the timeleft
cm_times ""                                             //Do not announce time left on NS
cm_highlander 0    //Toggle Highlander Mode. 0 - Off, 1 - On See the manual for details
cm_teleport 1    //Toggle Teleport 0 - Off, 1 - On See the manual for details
cm_record 2    //Toggle Record Demo and take Snapshots. 0 - Off, 1 - On, 2 - On w/Log
cm_slap 1    //Toggle Slap players. 0 - Off, 1 - On
cm_clientcmd 1    //Toggle execute commands on clients. 0 - Off, 1 - On See the manual for details
cm_banlist 1    //See the manual for details
cm_chatfilter 1    //Replacement for Bad Words. See the manual for details
cm_msgtime 10    //How many seconds admin messages should display on screen
cm_motdtime 8    //How many minutes in between MOTD messages
cm_msgpos 2    //Location of admin command messages 0 - Off, 1 - Top, 2 - Bottom
cm_chatspeed 0.5   //How many seconds between player chat (Flood protection)
cm_kickvoteratio 0.60   //Percent of votes needed to kick a player
cm_mapvoteratio 0.50   //Percent of votes needed to change the map
cm_customvoteratio 0.60   //Percent of votes needed for a custom vote to be successful
cm_autoban 0    //NS - SET TO 0. How many TK's on a map before the server bans a player
cm_autoban_period 15   //How long, in minutes, to ban a TK'er
cm_cancelvotekey 9    // Determins what button is used to cancel a custum vote

// ---------------------------------------------------------------------------
// Automated colored messages (MOTD)
// ---------------------------------------------------------------------------
// One line commented since I dont like to much spamming.
cm_motd ".:[ www.gobz.nu ]:." 200100000 5.00
//cm_motd ".:[ This Server Is Running ClanMod &clanmod_version& ]:." 255255000 5.00

// ---------------------------------------------------------------------------
// Automatically announce the next map 1 second prior to map change
// ---------------------------------------------------------------------------
// REMOVED
//cm_task 1 "cm_say @@@@ The nextmap will be &cm_nextmap&" bfuos "Shows the nextmap before a map change"


The cm_menu file:
CODE

// ---------------------------------------------------------------------------
// Commands for Custom Command Menu's
// ---------------------------------------------------------------------------

cm_cmd "Pause" "cm_pause" Sas
cm_cmd "Restart Round" "sv_restartround 1" Sas
cm_cmd "Triple Restart Round for Match" "cm_exec matches/rrauto.cfg" Sas
cm_cmd "Repeat Map" "cm_nextmap &cm_currentmap&" Sas
cm_cmd "      " " " Sas
cm_cmd "Reload Settings" "cm_say @@g Settings reloaded...;servercfgfile server.cfg;exec server.cfg" Scs
cm_cmd "List Players" "cm_listplayer" JSbm
cm_cmd "List Admins" "cm_listadmin" Obm
cm_cmd "List Tasks" "cm_listtask" Obm
cm_cmd "Show help" "cm_help" JSbm
cm_cmd "Show rules" "cm_rules" JSbm
cm_cmd "    " " " Sbm
cm_cmd "Logs are off" "log on;cm_say @@@g Logs are on" Sbns
cm_cmd "Logs are on" "log off;cm_say @@@g Logs are off" Sbhns
cm_cmd "separator1" "separator1" Sbhs
cm_cmd "Auto-restart is off" "cm_exec matches/auto.cfg" Sbns
cm_cmd "Auto-restart is on" "cm_say @@g Auto-restartround OFF;cm_remove task ?z;cm_remove task ?y" Sbhns
cm_cmd "Show timeleft" "say timeleft" JSbm
cm_cmd "Show nextmap" "say nextmap" JSbm
cm_cmd "Vote for map" "say votemap" JSbm
cm_cmd "Show current time" "say thetime" JSbm
cm_cmd "All votemap" "say votemap" Sdo
cm_cmd "      " " " Sds


// ---------------------------------------------------------------------------
// Commands for speech see speech.txt for list of available sounds
// ---------------------------------------------------------------------------

cm_cmd "Hey! Stop that!" "spk 'barney/donthurtem'" Weo
cm_cmd "Don't ask me" "spk 'barney/dontaskme'" Weo
cm_cmd "Don't think so" "spk 'barney/dontguess'" Weo
cm_cmd "Yup" "spk 'barney/yup'" Weo
cm_cmd "Nope" "spk 'barney/nope'" Weo
cm_cmd "Maybe" "spk 'barney/maybe'" Weo
cm_cmd "Seeya" "spk 'barney/seeya'" Weo
cm_cmd "Man that sounded bad" "spk 'barney/soundsbad'" Weo
cm_cmd "Hello and die" "spk 'vox/hello and die'" Weo
cm_cmd "Move!" "spk 'hgrunt/move! _comma yessir!'" Weo
cm_cmd "You will definitely pay!" "spk 'hgrunt/c2a2_hg_chat5a'" Weo
cm_cmd "Laughter" "spk 'hgrunt/c2a3_hg_laugh'" Weo
cm_cmd "Silence!" "spk 'hgrunt/silence!'" Weo
cm_cmd "You talk too much" "spk 'barney/youtalkmuch'" Weo
cm_cmd "You thinkin?" "spk 'barney/thinking'" Weo
cm_cmd "Open fire Gordon!" "spk 'barney/openfire'" Weo
cm_cmd "Couldnt make a bigger mess" "spk 'barney/bigmess'" Weo
cm_cmd "I have a Bad feeling" "spk 'barney/badfeeling'" Weo
cm_cmd "Yes sir!" "spk 'hgrunt/yessir!'" Weo
cm_cmd "No sir" "spk 'barney/nosir'" Weo


// ---------------------------------------------------------------------------
// Client Commands for Custom Command Menu's
// ---------------------------------------------------------------------------

cm_cmd "Aliens" "cm_clexec &name& readyroom;jointeamtwo" Efl
cm_cmd "Marines" "cm_clexec &name& readyroom;jointeamone" Efl
cm_cmd "Show'em the Rules!" "cm_rules;developer 1;echo '** READ THE RULES &name& **';developer 0;say 'Dont Shoot! I'm busy reading the server rules'" Efl
cm_cmd "Ready room" "cm_clexec &name& readyroom" ESf
cm_cmd "Bury Player" "cm_bury &name&" ESf
cm_cmd "Un-Bury Player" "cm_unbury &name&" ESf
cm_cmd "Gag Player" "cm_gag &name&" ESf
cm_cmd "Un-Gag Player" "cm_ungag &name&" ESf
cm_cmd "Mute VoiceComm" "voice_enable 0;developer 1;echo '** You have been muted for abusing VoiceComm **';developer 0;say 'I have been muted for abusing VoiceComm';spk 'hgrunt/silence!'" Efl
cm_cmd "UnMute VoiceComm" "voice_enable 1;developer 1;echo '** You have been unmuted (restart CS to regain VoiceComm) **';developer 0;say 'I have been unmuted'" Efl
cm_cmd "Slay" "kill;spk 'hgrunt/c2a2_hg_chat5a'" Efl
cm_cmd "Drop Weapon!" "drop" Efl
cm_cmd "Name Me Lamer" "name 'I am a Lamer, wonid:&wonid&'" Efl
cm_cmd "Name Me Camper" "name 'I am a Camper, wonid:&wonid&'" Efl


As you can see I have stripped much of the menu alternatives. The stuff removed were weapon restrictions ala CS and the setting of CB and such configurations. The three restarts and go is still here though, as is the load PUBLIC Settings alternative. I just renamed it to Reload Settings. I left the repeat map alternative here since it might just come in handy.

I have also addded the Ready Room alternative to the client command menu and renamed the CT and T alternatives to Marines and Aliens respectively.

EDIT
I have now changed the Aliens and Marines commands from CS style to NS style. I have'nt checked them out yet. Hope they work =]

I also removed some stuff from the conmotd.txt file. These will not affect gamplay in any way, but I show it here for completeness.

conmotd.txt:
CODE

"============================================================================="
""
"  Hello &name&, and Welcome to &hostname& server!"
"  The current map is &cm_currentmap& with &cm_timeleft& minutes left"
"  The next map will be &cm_nextmap&"
""
"============================================================================="
""
"  This server is running NS v1.01, AdminMod and ClanMod &clanmod_version&"
"  You may use/say the following commands:"
"  1. 'menu' Which will open the information menu."
"  2. 'votemap' Which will bring up the map vote menu."
"  3. 'myid' Which announces your personal info."
""
"============================================================================="


Thats it really!

IMPORTANT
You need to bind the keys 1-0 to slot1-slot10 for the menus to work!!!
Add this to your config.cfg (client-side)
CODE

bind 1 "slot1"
bind 2 "slot2"
bind 3 "slot3"
bind 4 "slot4"
bind 5 "slot5"
bind 6 "slot6"
bind 7 "slot7"
bind 8 "slot8"
bind 9 "slot9"
bind 0 "slot10"


Happy hunting!

EDIT: Things that won't work in NS
I will begin to start a list of things that do not work in ClanMod for NS. The idea is that I will add stuff to this list by editing this post. That way this stuff is easy to find. My intetion is not to create a complete list of stuff that doesnt work. I will add the things that I come across during causal NS play. I will try to create a quite comprehensive list though. Check back on this post once in a while.

Legend: [CM] Means feature in ClanMod. [ADMIN] Means feature in AdminMod



  • [ADMIN] admin_csay do not work. Probably due to the way NS displays text on screen
  • [CM] cy and all other clanmod commands for centertext do not work. Related to issue above.

EvilGrin
Debian package installs

You’ll need to download the package and install it using the apt-get command. You will have to be logged in as ROOT in order to install them. Use the following commands for lynx and unzip packages.

CODE

apt-get lynx
apt-get unzip


Once both are installed you should be able to type “lynx” and “unzip” at the command prompt to get either a lynx web browser (Q to quit) and a short help on the usage of unzip.
Vadakill
Woot!, nice guys. Let's keep the info flowing and make this the official thread for installs and configurations!
EKS
Updated ClanMod Config pack can be found here,
http://forums.unitedadmins.com/showthread....&threadid=16356

And you can download ClanMod here:
http://www.unitedadmins.com/ClanMod.aspx
Brutus
Couple of suggestions.

1.) You don't need to add +server.cfg on the command line. It is executed auto.

2.) add exec autoexec.cfg to the server.cfg file. In the autoexec.cfg file put maxplayers X (x being number of players you want your server to have.) If you do this then leave the +maxplayers line off the command line also. I find it easier to do this way, because you can change maxplayers whenever you want and it will change on map change.
Brutus
Adminmod is working on my server, and the user.ini file is correct and I am doing setinfo correctly, but for some reason it is now allowing me to do commands.
Phalck
Then the most probable problem is that something went wrong in the authentication process.

Check the following:

  • That the password field in adminmod.cfg is the same as the setinfo line in autoexec.cfg
  • Try enclosing the value assigned to the password field paramters with "-signs
  • The passwords are the same in the user.ini and the autoexec.cfg file
  • Join your server. In the console type disconnect. Type exec autoexec.cfg. Type retry. (Just to make sure the file is executed)
  • Try with no encryption on the passwords. Check the adminmod paramater for this in adminmod.cfg
  • Check the server-console (e.g. print-out in the screen application) for lines that say that adminmod is running correctly, that the users.ini file has been loaded etc
  • Checkt that there is a line in the console at login that says that you have become admin
  • Make sure that the commands you try work with NS. admin_say and admin_map will work
  • Make sure that you have the appropriate access level to execute the command, assign yourself the highest level of access for debugging purposes
Superfly
One quick comment on the use of Lynx..

try "wget" sometime. It is much nicer than lynx IMHO.

Syntax: "wget http://www.file.com/thisfile.tar" <-- this will find the file and download it.. It will work with FTP files as well.
Brutus
I found where I went wrong. When I made the users file I named it user.ini instead of users.ini.
BitchSL4P
Let me add to this another problem we've been seeing a lot of.

If you get the "LoadLibrary failed on ***/hlds_l/ns/dlls/ns_i386.so: libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory" error, look for a file named libstdc++-libc6.1-2.so.3 in your lib directory. If you find that make a symlink to it, i.e. ln -sf libstdc++-libc6.1-2.so.3 libstdc++-libc6.1-1.so.2.

-Slappy
Zildjian
Great newbie guide to setting up the server, I only have one question. I don't want to run an internet server, I want to run a LAN only server, for my college. What options to I need to pass when I start it up so that it will only show up on the lan, and users joining won't have to authenticate with WON (slows things down)?
Vadakill
You would set "sv_lan 1" in your server.cfg file or "+sv_lan1" to command line, also you will need to add "-nomaster" to your command line. I've also heard that you may have to "setmaster none" in your autoexec.cfg file for the server.
Zildjian
yeah, I got that fixed with the +sv_lan 1 and -nomaster. My problem now is that my server doesn't show up on the lan listings. You can go to the internet listings and specifically add my ip, but you can't see it in the lan listings. This may very well be something in the way that the campus lan is set up, but does anyone have any other suggestions?
SuicideDog
when you use the -nomaster switch it will prevent it from showing up in the lan listings.. I don't think there is a way to prevent it. I may be wrong though
Marlboro
In order for a LAN server to be automatically seen by clients on the LAN: You must not use +ip or -ip or +port or -port in your start line. Don't ask me why, I just know it doesn't work. The server has to be run on port 27015, or the clients will never see it. Yay, eh?
Winkie
QUOTE (Zildjian @ Nov 15 2002, 07:14 PM)
yeah, I got that fixed with the +sv_lan 1 and -nomaster. My problem now is that my server doesn't show up on the lan listings. You can go to the internet listings and specifically add my ip, but you can't see it in the lan listings. This may very well be something in the way that the campus lan is set up, but does anyone have any other suggestions?

Are you running in seperate broadcast domains? if you are that's probably why.
SkWyReL
Hey,
Im getting this crazy error. Tell me what ive done wrong.

./hlds_run: ./hlds: cannot execute binary file

I followed the directions exactly. Im running yellow dog linux on an iMac, that there may be the problem, but if you think you know what it is, reply.

Thanx
SkWyReL
EvilGrin
hlds_l is for x86 only. Its not going to work on a Mac.
RogueKiwi
Help<

I have 1 little problem so far! all went as it was supposed to as instructions,
anyway!went to run it [ ./hlds_run ] it don,t like! What's wrong here?Oh wise one,kissing foot!are we missing a run file here!
I loaded and did all the right things! running MANDRAKE 8.1 on an old Athlon 700meg Slot A

Cheers Dennis asrifle.gif
Vadakill
QUOTE (RogueKiwi @ Nov 22 2002, 03:46 AM)
Help<

I have 1 little problem so far! all went as it was supposed to as instructions,
anyway!went to run it [ ./hlds_run ] it don,t like! What's wrong here?Oh wise one,kissing foot!are we missing a run file here!
I loaded and did all the right things! running MANDRAKE 8.1 on an old Athlon 700meg Slot A

Cheers Dennis asrifle.gif

Make sure you are in the hlds_l directory when you try to run the server. Basically, you should be able to see the hlds_run file when you do an "ls -l" in the hlds_l directory.
RogueKiwi
biggrin.gif Tis good! one save my day! BUT!Oh Great one,kissing foot(Blath!!)
I still have a problem,Where as the item ./hlds_run not work'th machine don,t like it,it say no file exists! Tis the same if I use ls-l no such file! I thought the full bin file came out as a tar file with which you zap and move to Directory with all it,s goodies NOT a binary one!??

...note:
In directory hlds_l is File ds_l_3110_full.bin This was dumped in there by the hlds_l_3110_full.bin after running it,and NS directory with all the rest plus the 1.2 patch NO other files!Me being rank beginner is stuckith
fix please so me can beat'th my Son over head in gaming!(fat chance)Grin)

Cheers Dennis
asrifle.gif skulk.gif
SkWyReL
QUOTE
hlds_l is for x86 only. Its not going to work on a Mac.


Could i be or feel much stupider. This is one of those moments where you fall out of your chair screaming DUH!

Thanks...
SkWyReL
Vadakill
QUOTE (RogueKiwi @ Nov 22 2002, 08:42 PM)
biggrin.gif Tis good! one save my day! BUT!Oh Great one,kissing foot(Blath!!)
I still have a problem,Where as the item ./hlds_run not work'th machine don,t like it,it say no file exists! Tis the same if I use ls-l no such file! I thought the full bin file came out as a tar file with which you zap and move to Directory with all it,s goodies NOT a binary one!??

...note:
In directory hlds_l is File ds_l_3110_full.bin This was dumped in there by the hlds_l_3110_full.bin after running it,and NS directory with all the rest plus the 1.2 patch NO other files!Me being rank beginner is stuckith
fix please so me can beat'th my Son over head in gaming!(fat chance)Grin)

Cheers Dennis
asrifle.gif skulk.gif

"ls -l" has a space between the "ls" and the "-l", it tells linux to list the contents of the directory in "long" format.

If you have the "hlds_l_3110_full.bin" file you need to run it. To do that you need to "chmod 777 hlds_l_3110_full.bin" to give it permission to become an executable file then, run the file by typing "./hlds_l_3110_full.bin"

When it executes the file it will give you a license agreement, you have to agree to it and then it will extract the .tar.gz file that you can actually expand into the server structure. From that point you should be able to follow the guide the rest of the way into "offspring beatdown."

Vadakill
ChAoS
QUOTE
hlds_l_3110_full.tar.gz (120mb)(might be a .bin file, i.e. hlds_l_3110_full.bin)
ns_v1_linux_dedicated_server.tar.gz (85mb)
ns_102.zip


Do I need the ns_102.zip also for a Linux dedicated server install? Is that the patch and do I need to have find a .tar version of it or will the .exe work with Linux
n00b alrt
GoleX
QUOTE (ChAoS @ Nov 28 2002, 11:31 PM)
QUOTE
hlds_l_3110_full.tar.gz (120mb)(might be a .bin file, i.e. hlds_l_3110_full.bin)
ns_v1_linux_dedicated_server.tar.gz (85mb)
ns_102.zip


Do I need the ns_102.zip also for a Linux dedicated server install? Is that the patch and do I need to have find a .tar version of it or will the .exe work with Linux
n00b alrt

Well now you need 1.03 instead of 1.02. I usually unzip the zip on my machine, make all the changes needed to the config, then take the server down for a sec, upload it all, and bring it back up.

There is no .tar.gz version of the patches.
Say_Ten
Yes you need it. You can get an application called "unzip" for linux. I use FreeBSD so I installed it from the ports so I don't know it's official site.
ChAoS
Next question;

Since most of the links on the download page go directly to ns_install_v1.exe where can I find the 1.03 patch? A sticky with links would help tounge.gif
ChAoS
QUOTE ([F.o.R]Slappy @ Nov 15 2002, 03:29 AM)
Let me add to this another problem we've been seeing a lot of.

If you get the "LoadLibrary failed on ***/hlds_l/ns/dlls/ns_i386.so: libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory" error, look for a file named libstdc++-libc6.1-2.so.3 in your lib directory. If you find that make a symlink to it, i.e. ln -sf libstdc++-libc6.1-2.so.3 libstdc++-libc6.1-1.so.2.

-Slappy

I am getting this error


LoadLibrary failed on /home/chaos/halflife/hlds_l/ns/dlls/ns_i386.so: libstdc++-
libc6.1-1.so.2: cannot open shared object file: No such file or directory
Host_Error: Couldn't get DLL API from /home/chaos/halflife/hlds_l/ns/dlls/ns_i38
6.so!
FATAL ERROR (shutting down): Host_Error: Couldn't get DLL API from /home/chaos/h
alflife/hlds_l/ns/dlls/ns_i386.so!


How exactly do I do what you are talking about? I am a Linux newbie

update I dont have those lib files..
only these

libc-2.2.5.so
libc.so.6
Vadakill
The 1.03 server files can be found on the front page of the Natural-Selection (http://www.natural-selection.org) website. I believe this also takes care of the issue having to do with the library incompatibilities.
ChAoS
nope I installed the patch before I got this error
Vadakill
Go here: http://at.rpmfind.net/opsys/linux/RPM/libs...6.1-1.so.2.html

Click on your linux distribution. On the top there should be a BIG link with the RPM file you need. Install that as root and it should fix your problem.
ChAoS
Debian install...I dont believe I can use rpm packages. I use apt-get install blah blah

happen to know the name for blah blah?

Ive installed gcc and this is my lib dir

(see attached)
Lib Files
ChAoS
well that was a flop here i will attach it
Vadakill
See this post:

http://www.unknownworlds.com/forums/in...=7950&hl=debian

If that doesn't work I don't know what to tell you. Maybe someone else will be able to help you because I run RedHat not Debian.
ChAoS
That worked

thankyou thankyou thankyou
SkWyReL
is there a way to make HLDS start w/ linux just like httpd or xinetd or the other services?

.:SkWyReL:.
Brutus
What do you mean make it start? I use a script file that starts it so I don't have to do the long command line each time.
ChAoS
I thinks he wants to know how to set up those script files so when his machine restarts it will start the server.In fact I could use that knowledge too since I may have to reboot someday tounge.gif
Vadakill
This is what I do to make sure my server stays up and running, even after the power goes out. Keep in mind I'm doing this from a RedHat 7.3 perspective but it should work on most Linux based servers. some of the stuff I have in my files is a carry over from old times that I haven't bothered to clean up. I say if it works, don't dork with it. You will have to modify my examples below to fit your particular setup.

First up is an autoexec.cfg file which is stored in my ns folder. In it I have the following:

CODE

//
// autoexec.cfg
//   Server setup configuration file. This file is automatically executed once,
//   when the server is started.
//

//Location of the log files
logsdir logs

// Set up master servers to report to
setmaster add master0.gamespy.com 28900
setmaster add half-life.east.won.net 27010
setmaster add half-life.west.won.net 27010
setmaster add half-life.central.won.net 27010

// maxplayers <number>
//   Default: 6
//   Sets how many players are allowed on the server at one time. The maximum is
//   32 players. The more players you allow, the greater the upstream bandwidth
//   you will require.
maxplayers 13

// log <on|off>
//   Default: off
//   Use this command to enable logging on the server. See also the Logging
//   Settings in 'server.cfg'.
log on

// logaddress <ip> <port>
//   Default: (none)
//   If logging is enabled, this command allows log data to be sent to a remote
//   address. The log data is transmitted as UDP data packets, which can be
//   parsed by third-party applications. You can also set the logaddress to the
//   IP and port of your Half-Life client and the log data will be displayed in
//   the client console.
//logaddress 127.0.0.1 27500

// servercfgfile <filename>
//   Default: "server.cfg"
//   Sets the name of the configuration file which is executed at each map
//   change.
servercfgfile "server.cfg"

//
// Load Initial Map
//   Here we load the first map that the server will run. Nobody can connect to
//   the server until a map is loaded.
//
map ns_eclipse


Next I set up a shell script called "ns" that I store in my home directory. To create this file I do the following command:

CODE

touch ns


Then I make it executable by changing the mode:

CODE

chmod 755 ns


Then I "vi ns" to edit it and put in the following (modify as needed):

CODE

#!/bin/sh
cd /home/nshlds/hlds_l
export LD_LIBRARY_PATH=/home/nshlds/hlds_l:$LD_LIBRARY_PATH

screen -A -m -d -S ns ./hlds_run -game ns -pingboost 1 +ip xxx.xxx.xxx.xxx


Now you need a script to automatically check to see if your server is running and if not, restart it. You will need to "touch" this file and make it executable like described above. I call this file "hldsrestart.sh" In this file I have the following (modify as needed for your setup):

CODE

#!/bin/sh

if [ $( ps -aux | grep -v grep | grep -c "./hlds -game ns") = 0 ];

then

cd /home/nshlds/
./ns

fi


Basically what it does is run the process list command, removes any lines containg "grep" and then counts the number of occurances of "./hlds -game ns" that it finds. Then if that number is equal to "0" run the ns script. Hopefully that makes sense.

Now, you probably want to run this script every so often just to make sure your server is still alive. To do this you'll use a tool called "crontab". Crontab is a schedualling tool and it is very powerful. It's sorta like task schedualer in Windows with the exception that it actually works tounge.gif To edit your crontab you would do the following:

At the command prompt (you are logged in as your user not as root, right?) you would type:

CODE

crontab -e


You will then have a screen that looks an awful lot like "vi". Hit your "i" key to turn on insertion mode and then type in (remember to modify the paths to where your files actually are):

CODE

*/5 * * * * /home/nshlds/hldsrestart.sh


Once you have that in there, do a shift ZZ to save and close the file. It will say something like "Installing new crontab" breifly before giving your prompt back. What this does is every 5 minutes it runs the file called hldsrestart.sh. hldsrestart.sh then goes through the check to make sure that the server is up, if it isn't it calls the "ns" script to restart the server using screen.

Vadakill
GrimAdmin
Well, using a crontab entry like that is a cheap kludgy hack to keep the server running.

The real way to do it is to edit your init scripts to launch hlds_run.

To do so varies highly depending on your distribution. Assuming you are running SysV init, (which I'm not, and it's been a while science I was messing with init...):
1) look in /etc and find the folders for your various runlevels (/etc/rc[0-9].d) or for debian if my memory is right). This will be full of symlinks with names like S09[name].
2) determine your current/default runlevel. your default runlevel is set in /etc/inittab
3) add the correct symlink to the correct runlevel's directory to run the script that will start the seve
4) restart init and the sever should start.

If you run KDE, there is a GUI to help edit your init scripts.

I suggest checking man pages for init on your system before messing around with this.
ChAoS
Doesnt the server restart itself in the event of a crash when running on Linux? Or is that just CS?
GrimAdmin
In the Linux hlds install, there is an execuatable binary called "hdls" which is the server itself. there is also a file "hlds_run" that is a small Bourne shell script that will starts the server and restarts it when it dies.
Vadakill
GrimAdmin, could you please do a small write up on how to edit the initab to launch a NS server? The more examples of code, both command line and file editing, you put in the better. This would give begining admins a chance to learn something useful for other applications. I know kludgy scripting admins like myself would appreciate it!
GrimAdmin
I'll try and get around to it...

it will be a while, finals are next week, and I don't currently have a debain or RH box running...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.