SRCDS Steam group


Autorestart on crash
#1
Before anyone tells me to put "-autoupdate" in the command line and says that srcds_linux already auto-restarts servers on crash, listen I say. Yes, on most occasions it does auto-resart the server, but also on many it does not, and I end up finding out a day later that one my servers is offline. I was thinking of different approaches to fix this problem.

I started working on a python script that would send A2S_INFO queries to the selected server IP and port and restart the server if the query is not responded to (same concept as SRCDS Admin uses, but for linux). Then I started searching this forum and found that I can use "netstat -a | grep 27015" in order to see whether a specific port is being used.

So the reason I decided to come here and post is to ask of different solutions you guys use to auto-restart your servers or the ones you have for me. Please tell me what you have.
Reply
#2
(11-25-2011, 03:56 PM)Russianeer Wrote:  Before anyone tells me to put "-autoupdate" in the command line and says that srcds_linux already auto-restarts servers on crash, listen I say. Yes, on most occasions it does auto-resart the server, but also on many it does not, and I end up finding out a day later that one my servers is offline. I was thinking of different approaches to fix this problem.

I started working on a python script that would send A2S_INFO queries to the selected server IP and port and restart the server if the query is not responded to (same concept as SRCDS Admin uses, but for linux). Then I started searching this forum and found that I can use "netstat -a | grep 27015" in order to see whether a specific port is being used.

So the reason I decided to come here and post is to ask of different solutions you guys use to auto-restart your servers or the ones you have for me. Please tell me what you have.


I've not ran a Linux game server in a whe but a simple bash script checking for the server process should do it "ps -ef | grep srcds" if you have more than one game server running add a "| grep 27015" or what ever the port is.

Im sure if you search the site someone will have already written something you can run from cron or as a background process
Reply
#3
I think you have issue of server not crashing but going ghost. Because srcds_linux really has auto restart and it works Smile Going ghost may be due to bad addons and you better fix them. Though you can spend some time coding a script/service/php/whatever-you-want which will check if server actually works.
For example I have coded on fast hand java servlet which sends A2S_INFO (typo?) to gameserver and checks if it responds fine. If not, wait few minutes and hard restart the process.
Best Regards,
Stinkyfax
Reply
#4
(11-27-2011, 02:43 AM)Stinkyfax Wrote:  I think you have issue of server not crashing but going ghost. Because srcds_linux really has auto restart and it works Smile Going ghost may be due to bad addons and you better fix them. Though you can spend some time coding a script/service/php/whatever-you-want which will check if server actually works.
For example I have coded on fast hand java servlet which sends A2S_INFO (typo?) to gameserver and checks if it responds fine. If not, wait few minutes and hard restart the process.
I barely have any addons on the server. It's pretty much vanilla. The error that has been bothering me lately is "ERROR: Publish timed out after 60 seconds." I searched it on hlds mailing list and found out that people have it on both windows and linux and that their servers hang like that as well. Did anyone else have this issue or have solutions to fix it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)