SRCDS Steam group


Player rate tracking system using Linux's firewall (iptables)
#61
(01-13-2010, 07:07 AM)css Wrote:  Where are you hosted?
In France, in dedibox
http://www.dedibox.fr/dedibox-pro/serveur_dedibox_pro.html
Reply
#62
Hello,

I still have a little problem with the script.
The problem is that it stops all alone after 12 to 24h
I am forced to restart manually.
Reply
#63
I know the problem, but I experience the problem like every 1-4 weeks. It just stops without any error message. I've tried to debug it, but because it happens so rarely and without error message it's difficult to solve. I guess the problem is in the Rcon connection handling/sending/receiving part.

I've tackled the issue myself with a one-liner shell script:

Code:
while [ 1 ]; do ratetables.pl; sleep 5; done;

It starts the program if it stops. There's sleep 5, so it doesn't go into frenzy loop if something bad happens (eg. you accidentally remove or rename the script).
Reply
#64
looks very interesting and I'm going to give it a try.

before doing that, I've got 4 questions:
- does it really improve server performance when low-raters get sorted out?
- does it take additional cpu load and/or bandwidth, that destroys maybe the advantage?
- do I have to run ./ratetables.pl manually after each root server restart? (if so, how can I setup kinda autorestart for that?)
- where to put/install "while [ 1 ]; do ratetables.pl; sleep 5; done;" for the auto-restart in case it stops working?

thanks,
ulx
Reply
#65
(01-20-2010, 11:01 PM)ulx Wrote:  looks very interesting and I'm going to give it a try.

Great Big Grin

(01-20-2010, 11:01 PM)ulx Wrote:  - does it really improve server performance when low-raters get sorted out?

You don't have laggers with Ratetables running. I'm not sure if it improves the server in general at all, but if you're running public server you probably don't want Russian lagger with 90's computer jumping around there. Then on a war server this can be used to kick (or announce) low raters.

(01-20-2010, 11:01 PM)ulx Wrote:  - does it take additional cpu load and/or bandwidth, that destroys maybe the advantage?

No. Practically it's just parsing iptables output every X seconds. There's no performance loss.

(01-20-2010, 11:01 PM)ulx Wrote:  - do I have to run ./ratetables.pl manually after each root server restart? (if so, how can I setup kinda autorestart for that?)

No. You can run one installation of ratetables which automatically connects to the servers which are online.

(01-20-2010, 11:01 PM)ulx Wrote:  - where to put/install "while [ 1 ]; do ratetables.pl; sleep 5; done;" for the auto-restart in case it stops working?

This is due to mysterious bug in the program somewhere. When you start the program, you should start it with the aforementioned command. The command is shell script which restarts Ratetables if it happens to stop.

You can ask more questions here if you want help setting up the system with multiple servers. Also fugitif's posts are probably quite helpful for you.
Reply
#66
thanks a lot for your answers - very much appreciated!

so, if I follow your instructions I only have to run ./ratetables.pl for one time and it is back online even after a root reboot, right?

also, where/how gets "while [ 1 ]; do ratetables.pl; sleep 5; done;" executed? can I simply add it into another *.sh file that is already executed every minute on the server?

oh, another question concerning that html-output: has it to be the same dedicated root or can the output get sent to another server? I'm asking as I have an additional webserver and I want the output sent there.
Reply
#67
(01-21-2010, 01:20 AM)ulx Wrote:  so, if I follow your instructions I only have to run ./ratetables.pl for one time and it is back online even after a root reboot, right?

If you reboot your server, then you obviously has to start ratetables.pl again. Also make sure that when you've set it up once with the iptables rules, you have to use iptables-save to save the rules or write the iptables commands somewhere in your startup-scripts. You can also write the iptables rules to some script that you run manually after your server has rebooted.

(01-21-2010, 01:20 AM)ulx Wrote:  also, where/how gets "while [ 1 ]; do ratetables.pl; sleep 5; done;" executed? can I simply add it into another *.sh file that is already executed every minute on the server?

No. This command is started once and it runs forever. You can stop it by pressing ctrl-c continuously.

I recommend you start ratetables in a separate "screen" just like you start game servers in screen. The command is like:

1. screen -S ratetables
2. ./ratetables.pl

Make sure you start it as "root" user. Otherwise it won't work. It has to be able to use iptables command. You can detach the screen with normal "ctrl-a + d" and then you can restore the screen with "screen -r ratetables".

(01-21-2010, 01:20 AM)ulx Wrote:  oh, another question concerning that html-output: has it to be the same dedicated root or can the output get sent to another server? I'm asking as I have an additional webserver and I want the output sent there.

It writes the output only on local hard drive. You can try to set up some sort of automatical FTP transfer to your web server.
Reply
#68
Thank you
I'll try this command.

Code:
while [ 1 ]; do perl ratetables.pl; sleep 5; done;
I must put before the perl command, otherwise =>

Quote:[13:37:07]~/ratetables root@hostserver:~$ while [ 1 ]; do ratetables.pl; sleep 5; done;
bash: ratetables.pl : commande introuvable
[13:37:20]~/ratetables root@hostserver:~$ while [ 1 ]; do perl ratetables.pl; sleep 5; done;
[Sat Jan 23 13:37:38 2010]:
[Sat Jan 23 13:37:38 2010]: === Ratetables ===
[Sat Jan 23 13:37:38 2010]:
[Sat Jan 23 13:37:38 2010]: Author: Ghost
[Sat Jan 23 13:37:38 2010]: Website: http://css.setti.info/
[Sat Jan 23 13:37:38 2010]:
[Sat Jan 23 13:37:38 2010]: Ratetables started
[Sat Jan 23 13:37:39 2010]: Flushing "l4dtracking1" firewall chain for "L4D2 server1"
[Sat Jan 23 13:37:39 2010]: Flushing "l4dtracking2" firewall chain for "L4D2 server2"
[Sat Jan 23 13:37:39 2010]: Flushing "l4dtracking3" firewall chain for "L4D2 server3"
[Sat Jan 23 13:37:39 2010]: Flushing "l4dtracking4" firewall chain for "L4D2 server4"
[Sat Jan 23 13:37:39 2010]: Flushing "l4dtracking5" firewall chain for "L4D2 server5"
Reply
#69
Good work.

Do you have the rates.html somewhere in the web?
Reply
#70
(01-24-2010, 12:48 AM)css Wrote:  Good work.

Do you have the rates.html somewhere in the web?

Yes, I am sending you by private message.
Reply
#71
Have readded your rate tracking system.

My rates page:
http://dods.sg1.se/

But have problem that is that ratetables.pl dies.

I have it started in a screen.
Code:
screen -A -m -d -S rates ./ratetables.pl

How do i fix that issue?
Reply
#72
You can start it inside the screen like this:

First open the screen:

Code:
screen -S rates

Then inside the screen write
Code:
while [ 1 ]; do ./ratetables.pl; sleep 5; done;

That will restart it if it stops. If you can figure out why it stops you're great Smile

Then detach the screen with ctrl-a + d.
Reply
#73
(01-25-2010, 01:00 AM)css Wrote:  You can start it inside the screen like this:

First open the screen:

Code:
screen -S rates

Then inside the screen write
Code:
while [ 1 ]; do ./ratetables.pl; sleep 5; done;

That will restart it if it stops. If you can figure out why it stops you're great Smile

Then detach the screen with ctrl-a + d.

Yes, since I use your command, the script still crashes, but it restarts all alone.
Reply
#74
Perhaps i can find anything in syslog or so then why it crashes? or perl log? if there is any
Reply
#75
(01-27-2010, 01:15 AM)lhffan Wrote:  Perhaps i can find anything in syslog or so then why it crashes? or perl log? if there is any

There's nothing there.

I've seen these "crashes" in cases when the server is down and the rcon connection fails. The system says couple times the error about not being able to connect and then it just stops. There's no error message.

The worst part is that the crash is difficult to repeat.
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)