Forum

> > CS2D > Servers > Any Anti-Crash / Auto Restart?
Forums overviewCS2D overview Servers overviewLog in to reply

English Any Anti-Crash / Auto Restart?

19 replies
To the start Previous 1 Next To the start

moved Any Anti-Crash / Auto Restart?

Rygna
User Off Offline

Quote
Hello, Recently.. my Servers always getting Crash. i don't know why my server Always Crashed. maybe DDOS or Server-Side Issues.

but, is there Anti-Crash or Auto Restart Scripts to re-open cs2d_dedicated?.
i tried it but its failed and no working. after all, i tried all steps on google & websites.

if you have solution, please share it to me.
Thanks. also sorry for my bad english.

EDIT: My server OS is Linux. Specific?, Ubuntu 16.04.

Admin/mod comment

Incorrect section, this is merely related to servers. Moved. /user GeoB99

old Re: Any Anti-Crash / Auto Restart?

GeoB99
Moderator Off Offline

Quote
If I were you I would double check the tcpdump records and see the coming source of these null packets which flood your server. You can install it with the command as follows if you don't have it:

sudo apt-get install tcpdump


Afterwards take a track on all the traffic of your server and check it with
tcpdump -i eth0
.

As for an auto-restart script you could get it from thread cs2d Server Auto Restart script [LINUX/VPS] (solved), user Nekomata gave a very detailed tutorial on how to set up.

old Re: Any Anti-Crash / Auto Restart?

Rygna
User Off Offline

Quote
ahh, i got auto restart scripts from @user Nekomata. thanks @user GeoB99.

well, maybe this is server-side problem.. when my server reach 20 - 32 players, my server is crashed. is cs2d need so much ram to run 32player?

sry about my english.

old Re: Any Anti-Crash / Auto Restart?

DC
Admin Off Offline

Quote
No, CS2D does not need much ram at all. Unless you do crazy Lua things. Of course it depends on how much available memory your machine has for CS2D. If it is just a few megabytes you might run into problems.

You can check the memory usage under Linux with
top
or - with fancy colors -
htop
(needs to be installed first)

old Re: Any Anti-Crash / Auto Restart?

Hajt
User Off Offline

Quote
I bet that someone tried to flood your server. I highly recommend you to implement these iptables rules:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
IPT="/sbin/iptables"
DNS_SERVER="8.8.4.4 8.8.8.8"

iptables -F

for ip in $DNS_SERVER
do
	echo "Allowing DNS lookups (tcp, udp port 53) to server '$ip'"
	$IPT -A OUTPUT -p udp -d $ip --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
	$IPT -A INPUT  -p udp -s $ip --sport 53 -m state --state ESTABLISHED     -j ACCEPT
	$IPT -A OUTPUT -p tcp -d $ip --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
	$IPT -A INPUT  -p tcp -s $ip --sport 53 -m state --state ESTABLISHED     -j ACCEPT
done

$IPT -A INPUT -p udp -m udp --sport 19 -j DROP
$IPT -A INPUT -p udp -m udp --sport 53 -j DROP
$IPT -A INPUT -p udp -m udp --sport 1434 -j DROP
$IPT -A INPUT -p udp -m udp --sport 137:138 -j DROP
$IPT -A INPUT -p udp -m udp --sport 123 -j DROP
$IPT -A INPUT -p udp -m udp --sport 111 -j DROP
$IPT -A INPUT -p udp -m udp --sport 161:162 -j DROP
$IPT -A INPUT -p udp -m udp --sport 1900 -j DROP
$IPT -A INPUT -p udp -m udp --sport 27005 -j DROP
$IPT -A INPUT -p udp -m string --string "SAMPY" --algo bm --to 60 -j DROP 
$IPT -A INPUT -p udp -m string --string "HTTP/1.1 200 OK" --algo bm --to 75 -j DROP
$IPT -A INPUT -p udp -m length --length 0:28 -j DROP

Just save it in file and then execute, make sure that you use google dns servers.

old Re: Any Anti-Crash / Auto Restart?

GeoB99
Moderator Off Offline

Quote
@user Rygna: Normally the dedicated server should not take much RAM unless your computer is really old although I highly doubt as you run Ubuntu 16.04. You can check the RAM usage of processes with
top
command anyway. Note the RAM usage of a process is denoted as %MEM (Memory Usage in Percentage) and %CPU (CPU Activity in Percentage).

Either way you can check it with the Task Manager of Ubuntu, much friendlier way for the average Joe. Still I'd rather track and get the records of tcpdump to see what is happening with my server.

old Re: Any Anti-Crash / Auto Restart?

Hajt
User Off Offline

Quote
@user BcY: Hmm because google's ip is set in script above, also these dns are pretty fast and so far it works without any problems on my virtual servers.

old Re: Any Anti-Crash / Auto Restart?

gotya2
GAME BANNED Off Offline

Quote
Instead of checking whether the process still exists, it would be better to check whether the server is responding to 'request info' requests. In the past it used to happen that someone would flood a server with packets (DoS), and the server would still show up in the process list, it would however not respond to any packets and effectively be offline.

old Re: Any Anti-Crash / Auto Restart?

_Yank
User Off Offline

Quote
Basically what @user gotya2 said. I have a python script for that (it also checks if the server is using too much memory) but you'll have to wait a bit if you want it.

@user BcY: Yes, that part of the script isn't mandatory

old Re: Any Anti-Crash / Auto Restart?

Hajt
User Off Offline

Quote
@user mrc: Anti-ddos protection doesn't work because it is problem related to CS2D. You can flood the game server with low number of packets. I was able to DDoS @user Yates's dedicated server which had pretty strong anti-ddos protection in OVH so you know. These rules works against free ip stresser services.

old Re: Any Anti-Crash / Auto Restart?

Quattro
GAME BANNED Off Offline

Quote
Wow guys, what a hacker pros you are! Learn the difference for once:

"The Difference Between DoS and DDos Attacks. A Denial of Service (DoS) attack is different from a DDoS attack. The DoS attack typically uses one computer and one Internet connection to flood a targeted system or resource. The DDoS attack uses multiple computers and Internet connections to flood the targeted resource."
To the start Previous 1 Next To the start
Log in to reply Servers overviewCS2D overviewForums overview