Forum

> > CS2D > Servers > A New idea for protecting your server :D
Forums overviewCS2D overview Servers overviewLog in to reply

English A New idea for protecting your server :D

8 replies
To the start Previous 1 Next To the start

old A New idea for protecting your server :D

Ajmin
User Off Offline

Quote
Finally i found some manual commands for protecting your server!

First of all make a private server yourself,to protect the public (main) server.

and add this code to the private server's lua.
1
2
3
4
5
6
7
addhook("say","s")
function s(id,txt)
if txt=="start" then
os.execute("pkill server1")--- destination
os.execute("screen -s /root/cs2d-vps1/server1") --destination
end
end

Be careful both of the dedicated name should be unique!

And start the private server (should be pw protected).
The pw should be only known by ur friends etc..
When ur main server go off/dosed,ur friends or anyone else could type the "start" command and make the server online

Note:if u type the cmd twice then the server will be added twice!

If theres any way to identify if the server is on i will be able to use this automatically

Maybe its possible with the "ps aux" command.
But i d k how it will work.. etc.

This can also makes it more easier to start various servers with different cmds.

Thanks and Regards
Ajmin
edited 2×, last 02.03.15 08:34:07 am

old Re: A New idea for protecting your server :D

ead
User Off Offline

Quote
@user Ajmin:

I think it's better to create a script 'sh', I created a more'm adapting it works so you type the commands via SSH without user 'root', then you can start the command by opening with the 'screen' and will appear in the process list after you type an example 'servercs2d -restart', it will close the process and reopen it again and finally the command to disable (close) it 'servercs2d -stop'.

This and an idea that I'm almost done to create for my system, soon I'll post here in the forum.

old Re: A New idea for protecting your server :D

TopNotch
User Off Offline

Quote
user Ajmin has written
First of all make a private server yourself,to protect the public (main) server.

Crash both of them, ggwp.
By the way, although the cs2d server crashed, the screen is still alive, you should first kill that one, unless you want a shitload of detached screens.

old Re: A New idea for protecting your server :D

DC
Admin Off Offline

Quote
• This is for recovery (restarting a server) and not for protection. So the thread title is misleading.

• It's not efficient to run a second CS2D server just to have an easy way to restart another CS2D server. It works, but it's a bad idea because it's a waste of system resources and because the second server can be crashed too. Better use scripts like user ead said (how about a cronjob which automatically restarts the server?) or install a webinterface.

old Re: A New idea for protecting your server :D

ead
User Off Offline

Quote
@user DC: Good guy he works as it was a system process itself, plus the difference and it uses a sequence search the directory of the 'game' and then after using the chmod among other things you can restart and stop the server how many times you want to put giving a time of 15 seconds to 1 minute.

example:

First of all you start the script and then you start the server you start using the 'screen' or 'nohup', after that automatically identified the script that the process opened you type in SSH typing 'scrippt2 --help' (Appears options). I am trying to solve some errors including this one to identify the process and ask for help.
To the start Previous 1 Next To the start
Log in to reply Servers overviewCS2D overviewForums overview