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. Byłem zarządzania Counter-Strike: Source serwer prawie roku i uwierzcie mi, jest bardzo wrażliwe i zepsutego serwera utrzymać. Buggy in the sense that it crashes nearly everyday especially when you are running intensive mods such as ZombieMod or Garry's Mod. Buggy w tym sensie, że zawiesza się prawie codziennie szczególnie podczas uruchamiania intensywnych modów takich jak ZombieMod lub 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. Ponadto istnieją setki stron trzecich wtyczek dla Source i EventScripts co czyni go jeszcze bardziej niestabilny z powodu problemów ze zgodnością. It is not easy and time consuming to debug and find out what is causing the crash. Nie jest to łatwe i czasochłonne debugowania i dowiedzieć się co jest przyczyną awarii. So it is important to be able to auto restart the server when the srcds crashes. Tak więc ważne jest, aby móc automatyczny restart serwera po awarii SRCDS.

If you are running a CSS server on linux, the server itself already supports auto restarting srcds when crash. Jeśli używasz serwera CSS Linux, serwer sam już obsługuje auto ponownym SRCDS podczas zderzenia. However on Windows, you can do it via a batch file. Jednakże w systemie Windows, możesz to zrobić za pomocą pliku wsadowego. It works but it has its problems in doing that which I'll explain further. To działa, ale ma swoje problemy w sposób, które wytłumaczę dalej.

This is the batch file that you need to run to keep srcds.exe open by automatically running when crashed or closed. Jest to plik wsadowy niezbędny do utrzymania srcds.exe otwarte automatycznie uruchomiony podczas awarii lub zamknięte.

@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. Polecenie powyżej będą monitorować srcds.exe i natychmiast automatycznie uruchamia wiersz polecenia, jeśli nie jest uruchomiony. 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. No Valve zaleca, aby poczekać na co najmniej 10 sekund przed ponownym tak że nie ma dość czasu, aby oczyścić pamięć. I've used this batch and noticed that there were a few times the server crashes, restart, crashes again and restart. Użyłem tej partii i zauważyłem, że było kilka razy awarii serwera, restart, awaria i ponownie uruchomić. Previously I've written an Wcześniej pisałem article artykuł that contains a couple of free tools that can auto rerun program when closed but this time I needed something different. , która zawiera kilka darmowych narzędzi, które można ponownie uruchomić program automatycznie, gdy jest zamknięty, ale tym razem muszę coś innego.

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. I was looking for free, narzędziem, które może monitorować proces specyficzny, a następnie uruchomić "różne" sprawy po wykryciu awarii małe, proste i przenośnych. I found Restart on Crash which has been working perfectly ever since I started using it. Znalazłem Restart w Crash, który pracuje znakomicie odkąd zacząłem używać. Restart on Crash is an monitoring tool that will watch the applications that you specify and automatically relaunch any program that hangs or crashes. Ponownie na Crash to narzędzie do monitorowania, które będą oglądać aplikacje, które należy określić oraz automatyczne wznowienie dowolny program, który się zawiesza lub awarii. 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. Możesz dodać dowolną liczbę wniosków do monitora, włączenie / wyłączenie ich indywidualnie i edycji linii poleceń, które będą stosowane, aby ponownie uruchomić aplikację. 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. Ponownie na Crash nie wymaga instalacji i przechowuje wszystkie dane konfiguracyjne to w "settings.ini" pliku w folderze programu, więc jest przenośny. It should be compatible with most NT-based Windows versions. Powinien on być kompatybilny z większością NT wersji systemu Windows.

Basically the below image is the settings for the srcds server. Zasadniczo poniżej obrazu ustawienia serwera SRCDS. It monitors srcds.exe and when it isn't running, a run.bat file will be executed. Monitoruje srcds.exe a gdy nie jest uruchomiony, run.bat plik zostanie wykonane.
Ponownie na Crash

The more interesting part is the run.bat which is executed when the program detected that srcds.exe is not running. Najciekawsza część jest run.bat który jest wykonywany, gdy program wykrył, że srcds.exe nie jest uruchomiony. Since it is a batch file, I can program it to run multiple commands. Ponieważ jest to plik wsadowy, można go zaprogramować na uruchamianie wielu poleceń.
uruchomić program podczas awarii
The first command shows that I ping localhost 3 times. Pierwsza komenda pokazuje, że ping localhost 3 razy. This command is being used as a feature to wait for 3 seconds before going to the second command. To polecenie jest używane jako funkcja oczekiwania na 3 sekundy przed udaniem się do drugiego polecenia. The second command from the batch file is to execute Drugiego polecenia z pliku wsadowego jest do wykonania CleanMem CleanMem which is a tool to clean process and file cache to recover even more memory and performance. , który jest narzędziem do czyszczenia proces i pliku cache odzyskać nawet więcej pamięci i wydajności. Then again pause for 10 seconds before running srcds.exe with the full command line. Potem znowu zatrzymać na 10 sekund przed uruchomieniem srcds.exe z pełną linię poleceń. 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. Metoda ta została działa idealnie na tydzień już i nie potrzeba żadnych innych, bardziej zaawansowanych programów odzyskiwania po awarii, takich jak Firedaemon że ceny kosztów.

[ [ Download Restart on Crash Pobierz Restart w Crash ] ]

Technorati Tags: Technorati Skuwki: , , , , , , , ,