SRCDS Steam group


Problem starting stopping linux srcds
#1
I have a linux server, and the css server runs on it.

I made a script called start.sh

Code:
screen -A -m -d -S css-server ./srcds_run -console -game cstrike +map de_aztec +maxplayers 16 -ip 216.32.70.147 -port 27015 -autoupdate

If I don't include the "screen -A -m -d -S css-server" part it runs fine. But when I try to use the screen command I get this.

Code:
./start.sh: line 1: screen: command not found

How am I suppose to use the screen command? I'm using CentOS 4.

Also, what's the command to stop my server process? lol
Reply
#2
Wait, I think I got it. I guess I had to yum install screen...
Reply
#3
How do I stop my source server with a script?
Reply
#4
I normally just kill the process

type ps aux | grep portnumber

when you get the process id type

kill processid
Reply
#5
I run mine like a pseudo-service.

cstrike_server
Code:
#!/bin/sh
#
#
# Start/stop/restart a Source Dedicated server.
#
# file executable:  chmod 755 cstrike_server
#
# by c4onastick

cstrike_start() {
  if [ -x /usr/local/games/srcds/srcds_run ]; then
    echo "Starting Counter-Stirke Source Server:..."
    cd /usr/local/games/srcds/
    nohup ./srcds_run -game cstrike +map cs_office -maxplayers 32 > /dev/null 2>&1 &
  fi
}

cstrike_stop() {
  killall srcds_run srcds_amd
}

cstrike_restart() {
  cstrike_stop
  sleep 2
  cstrike_start
}

case "$1" in
'start')
  cstrike_start
  ;;
'stop')
  cstrike_stop
  ;;
'restart')
  cstrike_restart
  ;;
*)
  # No argument, echo usage
  echo "Usage: cstrike_server start|stop|restart"
esac

Just change the path to "srcds_run", the server options, and binary name ("srcds_amd") in killall to fit your system.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)