SRCDS Steam group


restart on quit
#1
Hello,

there is a script for restarting server in 10 seconds when a user say quit on console?

I use the screen

thanks
Reply
#2
What? What do you mean by the "screen?" Are you asking is there a script?
realchamp Wrote:
Hazz Wrote:Has someone helped you on these forums? If so, help someone else
Mooga Wrote:OrangeBox is a WHORE.
Reply
#3
Kaya Wrote:Hello,

there is a script for restarting server in 10 seconds when a user say quit on console?

I use the screen

thanks

SRCDS is built so that if a 'quit' command is sent, it will automatically restart the server in 10 seconds - no matter if its run in a screen or not.

If it still doesn't work, here are a few scripts:

http://forums.srcds.com/viewpost/25534#pid25534
Reply
#4
if u have the -autoupdate in the start up line it restarts with the command quit
Reply
#5
I just type 'ps -ejH' to find the process and then 'sudo kill <screenPID>' This is in Ubuntu 7.10.
Reply
#6
simply rcon quit in console
Reply
#7
'that guy', those commands work on any Linux distribution, kill and ps are original GNU tools Wink

Muppet - that link is a good one, however that is only for checking/restarting a server once a minute; they were asking about every 10 seconds here, and Cron only handles, at the very minimum, every minute.

I'm also curious myself as to the best way of doing this every 5-10 seconds.
Reply
#8
SRCDS is built so that if a 'quit' command is sent, it will automatically restart the server in 10 seconds - no matter if its run in a screen or not.

hmm mine doesnt do that :[
fedora 6
Reply
#9
if you have -autoupdate in the launch parameters it should.
Reply
#10
Even with -autoupdate in the parameters, it will take a while to restart since it checks for updates etc. For a game server provider or a serious server setup, a loop would be the best idea. This will restart your server instantly, and you will find it back up after a crash or rcon quit within around 1-2 seconds. This is the same idea as the Windows Batch restart script.

#!/bin/bash
# Restart script by devianTlinux
SCREEN_NAME="Set your screen name here"
count=1

while [ $count ]
do

# If no screen under that name was found...
if [[ `screen -ls | grep $SCREEN_NAME` == "" ]]
then
# Nothing was found running ; restart the server.
cd /your/srcds/dir/ ; screen -d -m -S $SCREEN_NAME ./srcds_run -game cstrike +map de_dust -secure +maxplayers 12
fi

done
Reply
#11
I am looking for a script, that I could use for all my servers to stop restart start.
I have 7 servers right now on my box.
User name is jake
so they are in /home/jake/servers/
In servers I have 7 folders one for each server.
Main thing I would like is to make sure if any server goes down it will restart itself after a minute.
I looked at this link here http://forums.srcds.com/viewpost/25534#pid25534
Thats to restart the servers everyday at 4, what code would I need to have it restart all the servers at 4am every wednesday?
Also for some reason the port on my server right now is some funky number "xx.xx.xx.xx:63830" I have -port 27015 in the command line to start.
Reply
#12
I wanted to post this link I found in another thread on here - a perfect Linux srcds start/stop/restart script, it's from steampowered.com forums.

It uses a similar 'while' loop like I was using to auto restart the server on crash. Give it a look!

http://forums.steampowered.com/forums/showpost.php?p=6480002&postcount=7
Reply


Forum Jump:


Users browsing this thread: 9 Guest(s)