SRCDS Steam group


server shutting down when ssh closed
#1
Hello is there any way to stop my server from shutting down when i close my ssh connection to my dedicated server?

login as: sshadmin
sshadmin@ssh.mortediventa.com's password:
Linux cl-t218-070cl 2.6.24-27-generic #1 SMP Fri Mar 12 00:52:19 UTC 2010 x86_64

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/
Last login: Thu Mar 25 16:51:17 2010 from 76.179.99.184
sshadmin@cl-t218-070cl:~$ cd srcds_l
sshadmin@cl-t218-070cl:~/srcds_l$ ./srcds_run -game cstrike -ip 174.142.211.49 -port 27015 +maxplayers 22 +map de_dust2 +exec server.cfg
Auto detecting CPU
Using AMD Optimised binary.
Server will auto-restart if there is a crash.

Console initialized.
Game.dll loaded for "Counter-Strike: Source"
maxplayers set to 32
maxplayers set to 22
couldn't exec banned_user.cfg
couldn't exec banned_ip.cfg
Network: IP 174.142.211.49, mode MP, dedicated Yes, ports 27015 SV / 27005 CL
Executing dedicated server config file
Incorrect price blob version! Update your server!
ERROR: mp_dynamicpricing set to 1 but couldn't download the price list!
Error: Material "sprites/bubble" : proxy "AnimatedTexture" not found!
Section [Scenes]: 0 resources total 0 bytes, 0.00 % of limit (2.10 MB)
appdatacache.cpp (311) : Assertion Failed: !"Implement me"
couldn't exec banned_user.cfg
couldn't exec banned_ip.cfg
Adding master server 72.165.61.151:27011
Adding master server 72.165.61.136:27015
Connection to Steam servers successful.
VAC secure mode is activated.
Reply
#2
If you make a new script called "srcds.sh" by
Code:
nano server.sh
[/quote]

In there, paste the following:
Code:
#!/bin/sh
cd srcds_l
echo "Starting SRCDS"
sleep 1
screen -A -m -d -S SRCDS ./srcds_run -game cstrike -ip 174.142.211.49 -port 27015 +maxplayers 22 +map de_dust2 +exec server.cfg

Now close nano by pressing "Ctrl + x", then "y" to save changes and "enter" to save the file.

Then you need to make the file executable by
Code:
chmod +x server.sh

Now to start your server, login to ssh, then type
Code:
./server.sh"

And you can now close your ssh

Christy
Reply
#3
Ensure screen is installed,

apt-get install screen

You can also run your command line with a "&" on the end also if you dont want a screen. Or use nohup.
Reply
#4
login as: sshadmin
sshadmin@ssh.mortediventa.com's password:
Linux cl-t218-070cl 2.6.24-27-generic #1 SMP Fri Mar 12 00:52:19 UTC 2010 x86_64

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/
Last login: Thu Mar 25 17:06:22 2010 from 76.179.99.184
sshadmin@cl-t218-070cl:~$ cmd
-bash: cmd: command not found
sshadmin@cl-t218-070cl:~$ cmd hi
-bash: cmd: command not found
sshadmin@cl-t218-070cl:~$ nano server.sh
sshadmin@cl-t218-070cl:~$ chmod +x server.sh
sshadmin@cl-t218-070cl:~$ ./server.sh
Starting SRCDS
./server.sh: line 6: -port: command not found
sshadmin@cl-t218-070cl:~$ nano server.sh
sshadmin@cl-t218-070cl:~$ chmod +x server.sh
sshadmin@cl-t218-070cl:~$ ./server.sh
Starting SRCDS
./server.sh: line 6: +maxplayers: command not found
sshadmin@cl-t218-070cl:~$
Reply
#5
You will have to put the script in to the server's root folder
Slå den med jeres fiberforbindelser...

[Image: 1308107839.png]
Reply
#6
Use screen or start the server:
./srcds_run -game cstrike -ip 174.142.211.49 -port 27015 +maxplayers 22 +map de_dust2 +exec server.cfg &
Reply
#7
login as: sshadmin
sshadmin@ssh.mortediventa.com's password:
Linux cl-t218-070cl 2.6.24-27-generic #1 SMP Fri Mar 12 00:52:19 UTC 2010 x86_64

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/
Last login: Fri Mar 26 20:10:28 2010 from 76.179.99.184
sshadmin@cl-t218-070cl:~$ ./server.sh
Starting SRCDS
Use: screen [-opts] [cmd [args]]
or: screen -r [host.tty]

Options:
-a Force all capabilities into each window's termcap.
-A -[r|R] Adapt all windows to the new display width & height.
-c file Read configuration file instead of '.screenrc'.
-d (-r) Detach the elsewhere running screen (and reattach here).
-dmS name Start as daemon: Screen session in detached mode.
-D (-r) Detach and logout remote (and reattach here).
-D -RR Do whatever is needed to get a screen session.
-e xy Change command characters.
-f Flow control on, -fn = off, -fa = auto.
-h lines Set the size of the scrollback history buffer.
-i Interrupt output sooner when flow control is on.
-l Login mode on (update /var/run/utmp), -ln = off.
-list or -ls. Do nothing, just list our SockDir.
-L Turn on output logging.
-m ignore $STY variable, do create a new screen session.
-O Choose optimal output rather than exact vt100 emulation.
-p window Preselect the named window if it exists.
-q Quiet startup. Exits with non-zero return code if unsuccessful.
-r Reattach to a detached screen process.
-R Reattach if possible, otherwise start a new session.
-s shell Shell to execute rather than $SHELL.
-S sockname Name this session <pid>.sockname instead of <pid>.<tty>.<host>.
-t title Set title. (window's name).
-T term Use term as $TERM for windows, rather than "screen".
-U Tell screen to use UTF-8 encoding.
-v Print "Screen version 4.00.03 (FAU) 23-Oct-06".
-wipe Do nothing, just clean up SockDir.
-x Attach to a not detached screen. (Multi display mode).
-X Execute <cmd> as a screen command in the specified session.

Error: Unknown option -game
sshadmin@cl-t218-070cl:~$ apt-get install screen
E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
sshadmin@cl-t218-070cl:~$

Server.sh

#!/bin/sh
cd srcds_l
echo "Starting SRCDS"
sleep 1
screen -A -m -d -S ./srcds_run -game cstrike -ip 174.142.211.49 -port 27015 +maxplayers 22 +map de_dust2 +exec server.cfg

This works when I run that command directly to the server what am I doing wrong
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)