I have been managing a Counter-Strike: Source server for nearly a year and believe me, it is a very sensitive and buggy server to maintain. He estat la gestió d'un Counter-Strike: Source servidor durant gairebé un any i creu-me, és un servidor molt sensible i buggy de mantenir. Buggy in the sense that it crashes nearly everyday especially when you are running intensive mods such as ZombieMod or Garry's Mod. Buggy, en el sentit que els accidents gairebé tots els dies, especialment quan s'està executant mods intensius, com ara ZombieMod o Garry's Mod Moreover there are hundreds of third party plugins for SourceMod and EventScripts which makes it even more unstable because of incompatibility problems. A més hi ha centenars de plugins de tercers per SourceMod i EventScripts que fa encara més inestable a causa de problemes d'incompatibilitat. It is not easy and time consuming to debug and find out what is causing the crash. No és fàcil i porta molt de temps per depurar i esbrinar què està causant l'accident. So it is important to be able to auto restart the server when the srcds crashes. Així que és important ser capaç d'auto reiniciar el servidor quan es bloqueja el srcds.

If you are running a CSS server on linux, the server itself already supports auto restarting srcds when crash. Si utilitzeu un servidor de CSS en Linux, el servidor en si suporta acte reiniciar srcds a l'accident. However on Windows, you can do it via a batch file. No obstant això, en Windows, podeu fer-ho a través d'un arxiu per lots. It works but it has its problems in doing that which I'll explain further. Funciona però té els seus problemes en fer el que vaig a explicar amb més detall.

This is the batch file that you need to run to keep srcds.exe open by automatically running when crashed or closed. Aquest és l'arxiu per lots que ha d'executar per mantenir srcds.exe obrir automàticament en funcionament quan es va estavellar o tancat.

@echo off
cls
echo Protecting srcds from crashes...
echo If you want to close srcds and this script, close the srcds window and type Y depending on your language followed by Enter.
title srcds.com Watchdog
: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

The command above will monitor for srcds.exe and immediately auto runs the command line if it's not running. La comanda anterior per supervisar srcds.exe automàtica i immediatament s'executa la línia de comandes si no s'executa. Well Valve recommends that we should wait for at least 10 seconds before restarting so that there is enough time for the memory to clear up. Bé vàlvula recomana que hem d'esperar com a mínim 10 segons abans de reiniciar, perquè hi hagi temps suficient perquè la memòria a aclarir. I've used this batch and noticed that there were a few times the server crashes, restart, crashes again and restart. He utilitzat aquest lot i es va adonar que hi havia un parell de vegades el servidor es bloqueja, reinicieu, els accidents de nou i reiniciar. Previously I've written an Anteriorment he escrit un article article that contains a couple of free tools that can auto rerun program when closed but this time I needed something different. que conté un parell d'eines gratuïtes que poden tornar a executar el programa d'auto quan està tancat, però aquest cop necessitava alguna cosa diferent.

I was looking for a free, small, simple and portable tool that can monitor for a specific process and then run a “different” file when it detects a crash. Estava buscant una eina gratuïta, petita, senzilla i portàtil que pot controlar per a un procés específic i després executeu l'arxiu "diferent" quan es detecta un accident. I found Restart on Crash which has been working perfectly ever since I started using it. He trobat Reinicieu l'accident que ha estat funcionant perfectament des que vaig començar a usar-lo. Restart on Crash is an monitoring tool that will watch the applications that you specify and automatically relaunch any program that hangs or crashes. Reiniciar Crash és una eina de vigilància a veure les aplicacions que s'especifica de forma automàtica i reiniciar qualsevol programa que es penja o es bloqueja. You can add any number of applications to monitor, enable/disable them individually and edit the command line that will be used to restart an application. Vostè pot afegir qualsevol nombre d'aplicacions per controlar, activar o desactivar individualment i editar la línia de comandes que s'utilitza per reiniciar una aplicació. Restart on Crash doesn't require installation and stores all it's configuration data in a “settings.ini” file in the program's folder, so it's portable. Reinicieu l'accident no requereix instal lació i emmagatzema totes les seves dades de configuració en un "settings.ini" fitxer a la carpeta del programa, així que és portàtil. It should be compatible with most NT-based Windows versions. Ha de ser compatible amb la majoria basats en NT versions de Windows.

Basically the below image is the settings for the srcds server. Bàsicament, la imatge de baix és la configuració del servidor d'srcds. It monitors srcds.exe and when it isn't running, a run.bat file will be executed. Supervisa srcds.exe i quan no s'està executant, un arxiu de run.bat serà executat.
Reiniciar Crash

The more interesting part is the run.bat which is executed when the program detected that srcds.exe is not running. La part més interessant és el run.bat que s'executa quan el programa detecta que srcds.exe no s'està executant. Since it is a batch file, I can program it to run multiple commands. Com que és un arxiu per lots, que es pot programar per executar diversos ordres.
executar el programa quan accident
The first command shows that I ping localhost 3 times. El primer comanda mostra que ping localhost 3 vegades. This command is being used as a feature to wait for 3 seconds before going to the second command. Aquesta funció és sent utilitzat com una característica d'esperar durant 3 segons abans d'anar a la segona ordre. The second command from the batch file is to execute El segon comandament de l'arxiu de procés per lots és executar CleanMem CleanMem which is a tool to clean process and file cache to recover even more memory and performance. que és una eina per netejar el procés i l'arxiu de memòria cau de recuperar la memòria encara més i el rendiment. Then again pause for 10 seconds before running srcds.exe with the full command line. D'altra pausa de 10 segons abans d'executar srcds.exe amb la línia de comandes completa. This method has been working perfectly for weeks already and I didn't need any other more advanced crash recovery software such as Firedaemon that cost money. Aquest mètode s'ha estat treballant perfectament durant setmanes i ja no necessitava cap altre més avançat programari de recuperació de falles, com FireDaemon que costen diners.

[ [ Download Restart on Crash Descarregar Reiniciar en Crash ] ]

Technorati Tags: Etiquetes de Technorati: , , , , , , , ,