SRCDS Steam group


auto restart? on crashes
#1
i know its possable but how exactly can i make it so when a server crashes it automatically restarts like on linux?
#2
Depends on which type of crash you're talking about - There's srcds crashes and then system crashes when your entire server goes down.

To just restart your srcds when someone RCON quits or it crashes you have to use a batch file like this:

Code:
:srcds
echo (%time%) srcds started.
start /wait srcds.exe -console -game cstrike +map de_dust +maxplayers 16
echo (%time%) WARNING: srcds closed or crashed, restarting.
goto srcds

You'll need to edit the command line in there to whatever you want your server to be set to.

To restart your server when your whole system crashes you'll need a program like FireDaemin that runs your srcds as a Windows Service. There's a couple other programs listed in this thread here :

http://www.srcds.com/forums/showthread.php?tid=79
[Image: minisig.gif]
#3
so do i have 2 keep that batch running? example if i have 8 servers on windows?
#4
Yeah - You'll need to create a batch file for each server and leave it running with the server so it auto-restarts it upon a quit/crash.
[Image: minisig.gif]
#5
thx mate i added it now too see if it works Smile
#6
No problem - Glad I could help Smile
[Image: minisig.gif]
#7
Hi all,

I realize this is a pretty old thread, but I've been running a Garry's Mod 10 server for the past few months and sometimes the server can crash every half an hour. I decided to look for some kind of auto-restart system for srcds.

I tred uS.Rooster's batch file but there's a very big problem with that - it restarts srcds.exe but it sits at the Start Dedicated Server window. How is an auto restart batch file going to help me if I still need to be at the computer to manually press the Start Server button?

Is there a way to bypass the Start dedicated server window? Or automatically hit the Start Server button?

-Thanks for any help you guys can provide.
#8
Don't use the steam-dedicated server. Use the console version (add -console to your startup parameters) and you wont be sitting/hanging on any window at all.

@Rooster: your batch only works if the server has some kind of very rare crash. When the srcds crashes it's mostly a "fatal error" crash and your batch does nothing about that. To restart it from those kinds of crashes you'd have to run it as a service.
#9
Doggie52 Wrote:Don't use the steam-dedicated server. Use the console version (add -console to your startup parameters) and you wont be sitting/hanging on any window at all.

Thank you very much for that little tip, doggie. I always wondered why -console was used in the startup parameters and I never used it assuming I didn't need it.

If it was mentioned somewhere that -console bypassed the server startup dialog box, I would have certainly used it. Sometimes features of srcds or Garry's Mod are poorly documented and keep users in the dark.

P.S. I created a simple AutoIt script that automatically detected the "Start Dedicated Server" window and hit Enter anyway Smile At least I won't have to worry about running that in the background anymore.
#10
Gah. I just tried running my server in console mode, it says my spacebuild map (sb_gooniverse_v2) doesn't exist, and that all of the sbox commands are unknown. Any particular reason that would happen? Here's what I've got in my command line parameters:

Code:
-game garrysmod -tickrate 33 -console +map sb_gooniverse_v2 +maxplayers 5
#11
That's weird, they do work in GUI mode?
Join the Source Dedicated Server Support Group on Steam Community!
Source Dedicated Server (SRCDS)
Free to join, Live support! (When available)

http://forums.srcds.com/viewtopic/5114
#12
I've tried several autorestart scripts, but every time my server crashes, I get the "srcds.exe has stopped working" error dialogue. My server doesn't restart until I click to close the program. This is a problem because I can't be there to click to close it every time it crashes. Is there any way to suppress this error?
#13
disable windows error reporting Smile
Join the Source Dedicated Server Support Group on Steam Community!
Source Dedicated Server (SRCDS)
Free to join, Live support! (When available)

http://forums.srcds.com/viewtopic/5114
#14
I tried that. That only disables the error being sent to microsoft, an error dialogue still pops up asking me to close the program.
#15
create an autoit script to monitor srcds


Forum Jump:


Users browsing this thread: 3 Guest(s)