Server's auto-restart
28 replies06.04.13 05:46:49 pm
How to make an auto-restart of the server, if it has crashed ? My VDS Linux Debian 6 OS
You know what? I don't know it.

Extremely Tricky
Admin/mod comment:
Why do you post then?! Imagine everyone who doesn't know the answer would post anyway. Please don't do that again!

explain to me how to do it?
Check here for your server - if not present, start it again. That's a very basic, of course. You also need to kill old process, for example.
He want to create script, which will restart server automatically (when it crashed in some reasons), he asks how to made one.
Extremely Tricky
You can make it with other programing language like C++. And you can simply make one code which will restart cs2d_dedicated.exe when is this process crashed/closed. This is not the only one way, but it's the easiest I guess.
Pseudo code:

Pseudo code:
Code:
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
if process("process") is running
{
return
}
else
{
restart
}
{
return
}
else
{
restart
}
edited 3×, last 06.04.13 06:44:11 pm
@
Tristam:
When server is crashed it's still running. Straight fail.
@
RoDioN1322:
Write a script to do that for you.

When server is crashed it's still running. Straight fail.
@

Write a script to do that for you.

edited 1×, last 06.04.13 06:53:19 pm
Restarting crashed with lua? Seems legit. You would use some out program to control system's process. Or hmmm... server could write to *.txt file log with time of last server's update (for example every minute) If file is not updated for one minute, out program will run cs2d_dedicated.exe one more time.
Trust me, I'm an engineer |
DC approved
Super extra mod for CS2D (64), yeah!



What I'm telling you is that when server is crashed it's still running (process). You should check serverlist instead.

Restarting crashed with lua? Seems legit. You would use some out program to control system's process. Or hmmm... server could write to *.txt file log with time of last server's update (for example every minute) If file is not updated for one minute, out program will run cs2d_dedicated.exe one more time.
Why so complicated dude.

Always more than one way to do something.
Always one way which is the most simple. Yet you can of course try to ping the port server is running on, Mr. I-had-to-reply-because-I-am-smart.

Ping the process? the hell?
Ping the port server is running on, idiot. <ip:port>

Ever heard of something called pgrep?
Code:
1
netstat -plant|grep ":22"
And never use pgrep because pgrep with cron will kill your RAM.
Look, I found a link for you.
http://www.linux.com/learn
You'll find many interesting things there.
Cute. I find it interesting in which you think I have to learn. Judging by the fact that I am using it and it works.
oxytamine has written:
That's inaccurate.

And never use pgrep because pgrep with cron will kill your RAM.
That's inaccurate.