Forum

> > CS2D > Servers > [SOLVED]Reopen closed/crashed server auto
Forums overviewCS2D overview Servers overviewLog in to reply

English [SOLVED]Reopen closed/crashed server auto

6 replies
To the start Previous 1 Next To the start

old [SOLVED]Reopen closed/crashed server auto

ReVoltage
User Off Offline

Quote
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..
edited 1×, last 15.12.13 07:46:09 am

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

ReVoltage
User Off Offline

Quote
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
edited 3×, last 15.12.13 07:45:52 am

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

lennon
User Off Offline

Quote
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?
To the start Previous 1 Next To the start
Log in to reply Servers overviewCS2D overviewForums overview