auto restart login game server (linux)
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
- diablodoro
- Posts: 67
- Joined: Thu Oct 11, 2007 8:54 pm
auto restart login game server (linux)
hello
can some one tell me is it possible to do something like 2 "sh" file
1rst can enter telnet restart the login server
second file that enter telnet make massage like "server restart 5min" then make command restart 300
and this 2 files do this like for LS every hour and for the game server like every 12 hour or something like this
it will be good if the script have timer that show ho much time left until restart something like
LS : 50min 40min 30min 20min 10min 5min 3min 2min 1min
GS: 12hour 6hour 3hour 1hour 30min 15min 10min 5min 3min 2min 1min
or something like this
can some one tell me is it possible to do something like 2 "sh" file
1rst can enter telnet restart the login server
second file that enter telnet make massage like "server restart 5min" then make command restart 300
and this 2 files do this like for LS every hour and for the game server like every 12 hour or something like this
it will be good if the script have timer that show ho much time left until restart something like
LS : 50min 40min 30min 20min 10min 5min 3min 2min 1min
GS: 12hour 6hour 3hour 1hour 30min 15min 10min 5min 3min 2min 1min
or something like this
- diablodoro
- Posts: 67
- Joined: Thu Oct 11, 2007 8:54 pm
Re: auto restart login game server (linux)
somting like this
Code: Select all
#!/bin/sh kill `ps xa | grep GameServer_loop | grep -v grep | cut -d' ' -f 1`kill `ps xa | grep LoginServer_loop | grep -v grep | cut -d' ' -f 1`killall javacd /usr/local/L2/gameserver/./startGameServer.shcd /usr/local/L2/login/./startLoginServer.sh
- diablodoro
- Posts: 67
- Joined: Thu Oct 11, 2007 8:54 pm
Re: auto restart login game server (linux)
hmm when i think about it
this is better the command its working five whit LS GS CS but i don't know how to make "cron" to reload it on the time i wish
Code: Select all
#!/bin/sh (echo "password"; sleep 3; echo "restart"; sleep 3; echo "exit") | telnet 127.0.0.1 123456
- diablodoro
- Posts: 67
- Joined: Thu Oct 11, 2007 8:54 pm
Re: auto restart login game server (linux)
The script is done.
login server
game server
I made the login server restart every 15 min and the game server restart every 12hours.
Therefore i used the Linux program "Schedule Task"; it's very easy to use and more stable and the best thing is that it can't crash and loads automatically on startup
how to use it :
1 install
2 open
3 select "New"
3 select "A task that launches recurrently"
4 Description: write something that reminds you about the process
5 command: to make the program work you need to enter a command such as "$HOME/L2J/Startup!/login_restart.sh"
6 Default behavior
7 select the time
8 click 'add'
9 and wait
I hope it will be of use
login server
Code: Select all
#!/bin/sh (echo "password"; sleep 3; echo "restart"; sleep 3; echo "exit") | telnet 127.0.0.1 12345
Code: Select all
#!/bin/sh (echo "password"; sleep 3;echo "announce 12h auto restart" ; echo "restart 300"; sleep 3; echo "exit") | telnet 127.0.0.1 12345
Therefore i used the Linux program "Schedule Task"; it's very easy to use and more stable and the best thing is that it can't crash and loads automatically on startup
how to use it :
1 install
2 open
3 select "New"
3 select "A task that launches recurrently"
4 Description: write something that reminds you about the process
5 command: to make the program work you need to enter a command such as "$HOME/L2J/Startup!/login_restart.sh"
6 Default behavior
7 select the time
8 click 'add'
9 and wait

I hope it will be of use

-
- Posts: 23
- Joined: Sun May 15, 2011 3:51 pm
Re: auto restart login game server (linux)
Thanks for this, it seems very symple and very usefull. ill give it a try.
-
- L2j Veteran
- Posts: 967
- Joined: Sun Mar 11, 2007 7:49 pm
- Location: Ukraine
Re: auto restart login game server (linux)
diablodoro wrote: I made the login server restart every 15 min

- Opiam
- Posts: 181
- Joined: Thu Jun 02, 2011 12:26 am
- Location: Europe, Ukraine
Re: auto restart login game server (linux)
How I can make the autostart for servers after system reboot?
ubuntu systems.
ubuntu systems.

- MELERIX
- L2j Veteran
- Posts: 6667
- Joined: Sat Sep 23, 2006 11:31 pm
- Location: Chile
- Contact:
- Opiam
- Posts: 181
- Joined: Thu Jun 02, 2011 12:26 am
- Location: Europe, Ukraine
Re: auto restart login game server (linux)
Thx. But it's not what I want.
For Example: my server's working, and suddenly he fell (power's off), my mego hoster - stand up, and deploy it. Then L2J Servers must up, in automatic mode, without user intervention.

- MELERIX
- L2j Veteran
- Posts: 6667
- Joined: Sat Sep 23, 2006 11:31 pm
- Location: Chile
- Contact:
Re: auto restart login game server (linux)
not a good idea to do that.
because some tables could be damaged (due power off), and if you start server with damaged tables, for example "items" or "characters" tables, db cleanup (on server start) could damage your whole db.
because some tables could be damaged (due power off), and if you start server with damaged tables, for example "items" or "characters" tables, db cleanup (on server start) could damage your whole db.
- Opiam
- Posts: 181
- Joined: Thu Jun 02, 2011 12:26 am
- Location: Europe, Ukraine
Re: auto restart login game server (linux)
What you thinking about backups. Is it a variant?MELERIX wrote:not a good idea to do that.
because some tables could be damaged (due power off), and if you start server with damaged tables, for example "items" or "characters" tables, db cleanup (on server start) could damage your whole db.
Can you write for my and another megа programmers bush for Unbunty OS with check with a good connection to the database tables or something like this... please help me, becouse after some days I will not have enough time for watching for my serv...

- diablodoro
- Posts: 67
- Joined: Thu Oct 11, 2007 8:54 pm
Re: auto restart login game server (linux)
well you can make this for backup
make the server.sh and game.sh start on startup
then you can make the script not to restart the server but to shut it down
then you can make the PC restart
and you get this
server restart 300 sec
after 300 sec it will delay 10-20 sec more in case of something go wrong
after the server is down you tell the hour mysql to make back up
afther the back up is ready you make the PC restart
then when the PCstart it load the login.sh and game.sh automatick
PS: backup don't take more then 30 sec the system restart on linux is 10 sec max the startup of the server is from 90 to 120 sec and +from 30 to 60 sec for delay you will get everything done for like less then 5 min i think its great to make full restart time a day
and you get
1 full restart
2 backup
3 you do it fully automatic
its not so hard you can do it on every system
and the most easy way is to use terminal
if you need more help you are welcome to pm
PS2 i made some event autostart whit this command this save GM online time
and players are happy that event is on time 
make the server.sh and game.sh start on startup
then you can make the script not to restart the server but to shut it down
then you can make the PC restart
and you get this
server restart 300 sec
after 300 sec it will delay 10-20 sec more in case of something go wrong
after the server is down you tell the hour mysql to make back up
afther the back up is ready you make the PC restart
then when the PCstart it load the login.sh and game.sh automatick
PS: backup don't take more then 30 sec the system restart on linux is 10 sec max the startup of the server is from 90 to 120 sec and +from 30 to 60 sec for delay you will get everything done for like less then 5 min i think its great to make full restart time a day

and you get
1 full restart
2 backup
3 you do it fully automatic
its not so hard you can do it on every system
and the most easy way is to use terminal
if you need more help you are welcome to pm

PS2 i made some event autostart whit this command this save GM online time


Last edited by diablodoro on Tue Jun 28, 2011 11:21 pm, edited 1 time in total.
- diablodoro
- Posts: 67
- Joined: Thu Oct 11, 2007 8:54 pm
Re: auto restart login game server (linux)
best back up is on shutdown server this way you are sure that the back up is 100% and something is not missing
most servers make backup 2 times a day

- Opiam
- Posts: 181
- Joined: Thu Jun 02, 2011 12:26 am
- Location: Europe, Ukraine
Re: auto restart login game server (linux)
What's the difference when you make a backup of db, when server's on or off?diablodoro wrote:best back up is on shutdown server this way you are sure that the back up is 100% and something is not missingmost servers make backup 2 times a day
After a restart everything will fall into place.

-
- Posts: 64
- Joined: Tue Apr 13, 2010 12:36 pm
Re: auto restart login game server (linux)
tbh if your working from a server that doesnt have a UPS, your kinda asking for trouble during a powercut. with a strong enough UPS you can keep the server running normaly for upto 48 hours which would meen you wouldnt have to worry about a powercut, if the hosting company doesnt have one it would be wise to switch providers.
if its a home pc, well then i guess you could make edits to your system files (not recomended) where on startup it runs the server startup files (again not recomended)
if its a home pc, well then i guess you could make edits to your system files (not recomended) where on startup it runs the server startup files (again not recomended)
Scepter - Main man with a plan.