SRCDS Steam group

Linux Dedi Server Help.
I just started to use Linux for the dedi box we rented. I can start my server from putty (SSH) but when I close it the game server closes as well.

The dedicated server is not in my house and I wanted to know a way to keep it running without having putty open. I tried to search on the forums but I have no clue how the term is called for that.

Any help would be great.

With this: (probably best for you)
Excellent, thanks for the quick reply, will try it out right now!
echo "Starting Cs:Source Server"
sleep 1
screen -A -m -d -S css-server ./srcds_run -console -game cstrike +map de_dust +maxplayers 16 -autoupdate

Put that into a .sh file preferably
then all you have to do is run the .sh (./

*note: fill in with your game
Ok, heres the noob friendly answer.

You need to install a program called screen. Essentially what it does is keep whatever you had open in that SSH window running in a virtual screen (hence the name).

You will have to install as most dedi-boxes i have come across don't have it, but its easy.

if its ubuntu or debian:
apt-get install screen

if its RHEL, CentOS or similar:
yum install screen

then all you will need to do is type in screen, hit enter THEN run your server. To bring up your server again, just use screen -r in SSH and it will bring you back to the window you left open. If you run multiple screen windows it will just list numbers when you hit -r, so just for example do screen -r 3345 (imagining 3345 was one of those numbers).

Although the above post to put in a .sh text file would work much better.
Thanks Skyride. Much better explained for a real noob Smile
I got it working but now if I need to restart the server how would I do this. I looked online but I am uncertain as to how to stop the screen command to restart my game server.

I know I need to get a game panel setup. I'm looking at swiftpanel currently. Until then what would be the command to stop the server?
To start it without screen just put the command you use to startup in a .sh file you wont be able to see whats in it but you can still close putty and have the server running. To kill the server, kill the .bin and the srcds process listed in ps -ax ( i think been a while since i used linux)
[Image: b_350x20_C002748-004880-FFFFFF-000000.png]
Sorry I am very new to linux, you lost me pengy Sad
Log into the account the server is running on and do screen -r to resume the screen session, then you can just control + c to kill the screen and server. Otherwise you can use ps -aux to list all the running processes and look for the screen and get it's UID, then just do eg: kill 2342
You may find it useful to create scripts so you're not typing (or hitting up + enter) all the time.

SSH into your server and type in:

nano (if nano isn't installed then pico

Edit this as needed and paste it into nano (right-click usually pastes):

cd /path/to/srcds_run (replace this with your path, e.g. ~/srcds_l/orangebox)
screen -a -m -d -S srcds ./srcds_run -console -game tf(rest of your server command line goes here)

Once you've pasted it into nano, hit ctrl+o then enter to save the file, followed by ctrl+x to exit.

Make a second file called (nano Edit this appropriately and paste it into nano:

cd /path/to/ (replace this with your path, e.g. ~/srcds_l/)
ps ax | grep '[s]rcds_run' | awk '{print $1}' | xargs kill

Once you've pasted it into nano, hit ctrl+o then enter to save the file, followed by ctrl+x to exit.

Finally, tell Linux it's ok to run these files:

chmod +x
chmod +x

And you're done.

Now you can change to the directory you saved them in:

cd /path/to/scripts (e.g. ~/srcds_l)

and start/restart the server:

knoid || Admin, gaming community - challenge maps - custom maps
Thanks guys! I did what you told me plus I added swiftpanel and everything is working top notch now.
[Image: b_350x20_C692108-381007-FFFFFF-000000.png]
[Image: b_350x20_C692108-381007-FFFFFF-000000.png]
Founder - - A TF2 Community

Forum Jump:

Users browsing this thread: 1 Guest(s)