Server rentals :: NFOservers.com

Forums

All times are UTC - 8 hours



Author Message
 Post subject: CS:S on a Linux install
PostPosted: Mon Dec 07, 2009 1:33 pm 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9232
Location: Seattle
This is a fairly straightforward retooling of our CS 1.6 guide here: viewtopic.php?f=46&t=4163. The two procedures are extremely similar.

Linux can be a bit more complicated to use than Windows, and generally Source server performance is better on Windows, so we recommend against using Linux unless you are already familiar with the OS and prefer it for other reasons than running game servers. That said, here's how to get going, from scratch, using our Gentoo Linux (+ Source game install) package.

1. Log in to your VDS through SSH. You can do this by loading up Putty, then connecting to your server using the information given on the "Server control" page in your control panel.

2. Change to the correct directory for CS:S.
Code:
cd /usr/steam/sourcebase/css

3. Gentoo users can skip this step. On CentOS, install the "screen" utility with this command:
Code:
yum install screen

4. Start up your server inside a "screen" session with a command like this:
Code:
screen -AmdS screenname chrt -r 20 ./srcds_run -game cstrike -ip xxx.xxx.xxx.xxx -maxplayers xx

Where "screenname" is an identifier you want to use for the screen (so that you can reconnect to it later), and the "x"s represent the actual IP and maxplayers that you wish to use.

5. Your server will now be running in the background (inside what's called a "pseudo terminal"), and will continue running, even after you close your SSH window. To view it in the foreground, type this:
Code:
screen -r screenname

Where "screenname" is the same one that you used when you started the server.

To hide the screen session again, hold down the control key and hit "a"; then, let go of both keys and hit "d". You should see the message "[detached]" and be returned to the normal command prompt.

6. To make the server start up when the machine is started, edit /etc/conf.d/local.start (Gentoo) or /etc/rc.local (CentOS) and add the same lines you used above. You can easily edit it with this command:
Code:
nano /etc/conf.d/local.start

or:
Code:
nano /etc/rc.local

And add the lines:
Code:
cd /usr/steam/sourcebase/orangebox
screen -AmdS screenname chrt -r 20 ./srcds_run -game cstrike -ip xxx.xxx.xxx.xxx -maxplayers xx

To exit out of the text editor, use "Control-X" and enter "Y" when it asks if you want to save the file.

The easiest way to run multiple servers is to copy the "sourcebase" folder to a second one:
Code:
cd /usr/steam
cp -rp sourcebase sourcebase2

Then, simply follow the instructions given above, adapted for the different folder and other IP address.

A few other useful "screen" commands to get you going:

Code:
screen -ls

Shows a list of running (and detached) screens.

Code:
screen -DR screenname

Detach a screen remotely and then reattach it to your session (if you left it attached in a window on a different machine, or your SSH connection was interrupted, this can be very useful to recover it).

Code:
screen -wipe

If you rebooted your machine and the old screen shows in "screen -ls" as "dead", you can use this to remove it from the list.

Control-a, Escape will let you cursor through the screen buffer while you are attached to a screen. Hitting Escape again will get you back out.


Top
 Profile  
 
PostPosted: Wed Sep 22, 2010 12:32 am 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9232
Location: Seattle
After you've gotten your CS:S server up and working, it's best to switch it to running as a user other than root. When I have some time, I'll work on adding more information on how to do that :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
It is currently Tue May 21, 2013 10:39 am
Powered by phpBB® Forum Software © phpBB Group