Question

Game Server 24.7

  • Posted August 5, 2013

Hi, I’m running a Counter-Strike: Source gameserver but when I close the putty client, the server just shuts down , sometimes when i close it doesn’t shut down which is weird, so all goes well, ubt whenever the server gets no activity for lets say, 30 minutes , i just shuts down, how can I keep my CS:s server up 24/7? Is there something I need to add to the command line to keep it up 24/7? Here’s my current command line:

./srcds_run -game cstrike +port 27015 +maxplayers 16 +map de_dust2 -secure

Subscribe
Share

Add ‘&’ at the end of your command line. This will launch the command in background.

At this time, your server is shutting down because your command is attach to your SSH prompt.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Don’t do any of that. <br> <br>Just run: <br> <br>./srcds_run -game cstrike +port 27015 +maxplayers 16 +map de_dust2 -secure > /dev/null 2>&1 & <br> <br>The issue is your server trying to write to the output pipe and it not being available since the ssh session is closed. Just pipe your output to dev null instead, the server will still have logs, it just won’t log back to console and crash.

@bgclan: Once you run the gameserver, you should detach the screen session by pressing <strong>ctrl +a, d</strong>. You should be back to your shell once you do that. You can then disconnect and the server will still be running.

Hi … <br>Type: screen -r

Sorry for triple post, I have another question, how do I access the console in my SSH while the server is running?

Thanks, the server is running, but hopefully it doesn’t crash when inactive like usual, I’ll see how it goes.

How do I make a screen name?

Sorry for the double post, helping you to run you a screen command (install screen first, google it). <br> <br>Then run your Counter Strike through this: <br> <br> screen -A -m -d -S SCREENNAME ./srcds_run -game cstrike +port 27015 +maxplayers 16 +map de_dust2 -secure <br> <br>SCREENNAME is the name of your counter strike screen. <br>For example “CSServer”. <br>re-attach to your screen with “screen -r” without quotes. It should work, unless you are running multiple servers of CS. <br>you can list your screens with this command: “screen -ls” without the quotes. <br> <br>Hf. <br>

Yes, it will. <br>Otherwise he wouldn’t tell you ;).

This will keep my server on 24.7 even when players aren’t online?

Install and use screen. Screen creates a virtual console that doesn’t close when putty closes. <br> <br>Login with putty <br>run screen <br>run your game server <br>Then disconnect from putty or press ctrl+a+d to detach from the screen. <br>To re-attach run ‘screen -r’