Forum

> > CS2D > Servers > [SOLVED]Reopen closed/crashed server auto
ForenübersichtCS2D-Übersicht Servers-ÜbersichtEinloggen, um zu antworten

Englisch [SOLVED]Reopen closed/crashed server auto

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt [SOLVED]Reopen closed/crashed server auto

ReVoltage
User Off Offline

Zitieren
Hello us ,
I have a problem with my server this time.
I dont know if it my VPS problem or the server problem.
Is there anyway to automatic turn on the server when its offline? Is this possible?
Im using linux for hosting, maybe there is a way to do this with command or something?
Because im tired of my server crashed again and again.
I hope linux master are here
Thanks before..
1× editiert, zuletzt 15.12.13 07:46:09

alt Re: [SOLVED]Reopen closed/crashed server auto

ReVoltage
User Off Offline

Zitieren
Uhh.. I just do some searching in google.
But how to detect cs2d_dedicated process and run cs2d_dedicated again if it not open automatic?
Can someone give me and code example for this?

EDIT: now i found this code to check if it running or not.
1
2
3
4
5
6
ps cax | grep cs2d_dedicated > /dev/null
if [ $? -eq 0 ]; then
  echo "Running."
else
  echo "Not running."
fi
I just test the code and its work, but how to run it with contrab (scheduled) and run cs2d_dedicated if its return "Not running"?

EDIT2: While waiting for the answer, I have try a way to do this.
I make .sh file in root, that file contain code to check if cs2d_dedicated is working or not, if it not then it will turn it on.
Then i make contrab every 5 minutes to run the .sh file.
So would this work properly as I want or not?

EDIT3: I just convert DOS file to UNIX file and its work. Problem solved by myself
Big thanks to user ohaz and user tonton2d
3× editiert, zuletzt 15.12.13 07:45:52

alt Re: [SOLVED]Reopen closed/crashed server auto

lennon
User Off Offline

Zitieren
i try to make autorestart with this


1
2
3
4
5
6
7
ps cax | grep cs2d_dedicated > /dev/null
if [ $? -eq 0 ]; then
  echo "Running."
else
  echo "Not running." 
if [echo "Not running."; then
nohup /home/cs2d/cs2d_dedicated > /dev/null 2>&1 &

but dont work, anybody have ideas?
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Servers-ÜbersichtCS2D-ÜbersichtForenübersicht