Jump to content
×
×
  • Create New...
  • 0

Time back after reboot


DarkFire

Question

17 answers to this question

Recommended Posts

  • 0

First one you need to kill processes and after that to do reboot.

For can make all very easy, just use command:

cd /usr/home/game && sh close.sh && reboot

Or you can make like this:

  • Create a file with name reboot.sh in ../usr/home/game/
  • Put this in him:
#!/bin/sh
#If processes change their name, killall may not be able to match them correctly, so change "game" or "db" with your name, type "ps" or "top" for know.
echo -e "Kill processes and reboot server ..."
killall game && killall db && reboot

e12452ee79844ec3b7057c591d53d835.png

And when you want to make a reboot just type command: sh reboot.sh

  • Love 1
Link to comment
  • 0
11 minutes ago, Tasho said:

First one you need to kill processes and after that to do reboot.

For can make all very easy, just use command:

cd /usr/home/game && sh close.sh && reboot

Or you can make like this:

  • Create a file with name reboot.sh in ../usr/home/game/
  • Put this in him:
#!/bin/sh
#[i] If processes change their name, killall may not be able to match them correctly, so change "game" or "db" with your name, type "ps" or "top" for know.
echo -e "Kill processes and reboot server ..."
killall game && killall db && reboot

e12452ee79844ec3b7057c591d53d835.png

And when you want to make a reboot just type command: sh reboot.sh

 

You also need to wait 5-10 seconds sometimes

#!/bin/sh
#[i] If processes change their name, killall may not be able to match them correctly, so change "game" or "db" with your name, type "ps" or "top" for know.
echo -e "Kill processes and reboot server ..."
killall game db && sleep 10 && reboot

You can also move reboot.sh intro /usr/local/sbin and name it simply  r in this way you not need always to cd /path/to_reboot.sh

you can write simply  r and enter .. etc

 

 

43 minutes ago, DarkFire said:

Hi , devs . After reboot , on my server the time is going back. How to repair this?

 

  • Love 1
Link to comment
  • 0
3 minutes ago, tierrilopes said:

To restart the server you dont need to reboot the machine.

Theres no need of that.

Send me your shutdown script by pm and i will fix it.

There is nothing to be fixed. killall name_of_game name_of_db is already enough

Just remove && reboot from Tasho .sh

Link to comment
  • 0
1 minute ago, tierrilopes said:

Thats why most of pservers are crap, with "solutions" like those.

:facepalm: Really ?  Do you know what a .killscript is ?

killall sends a signal to all processes running any of the specified commands. If no signal name is specified, SIGTERM is sent.

KILL ALL don't kill the process directly / send the SIGTERM

 

void signal_setup(void)
{
	signal_timer_enable(30);
	signal(SIGVTALRM, checkpointing);
	signal(SIGHUP, hupsig);
	signal(SIGCHLD, reap);
	signal(SIGINT, hupsig);
	signal(SIGTERM, hupsig);
	signal(SIGPIPE, SIG_IGN);
	signal(SIGALRM, SIG_IGN);
	signal(SIGUSR1, usrsig);
}

 

SIGTERM don't close you program imediatly. Just use killall game you will see in you syslog those lines

	sys_log(0, "<shutdown> Shutting down CHARACTER_MANAGER...");
	sys_log(0, "<shutdown> Shutting down ITEM_MANAGER...");

      etc and more

this means you program is shutdown correct ;)

KILLALL just send the signal , not close you program directly.

 

 

Please watch you language. There are difference bettwen SEND SIGNAL and kill instant.

  • Love 1
Link to comment
  • 0
Just now, tierrilopes said:

Are you trolling yourself? Please.

Before killall  

c4b17958f537420cb42ca6243aaf2d5d.png

 

After killall

a1a55fbcb4c742be80737d2796cc0807.png

 

That does not mean the program is closed directly.

As you can see game is not closed because he need to close all of his threads and all runing stuffs.

Destroy arenaManager

Destroy ItemManager

Destroy CClientManager

When u see in syslog  

this mean there is nothing shit when using KILLALL

 

I try to explain you because you used " SHIT " word :)  Thank you

 

  • Love 1
Link to comment
  • 0
  • Premium
3 minutes ago, Ikh said:

Before killall  

c4b17958f537420cb42ca6243aaf2d5d.png

 

After killall

a1a55fbcb4c742be80737d2796cc0807.png

 

That does not mean the program is closed directly.

As you can see game is not closed because he need to close all of his threads and all runing stuffs.

Destroy arenaManager

Destroy ItemManager

Destroy CClientManager

When u see in syslog  

this mean there is nothing shit when using KILLALL

 

I try to explain you because you used " SHIT " word :)  Thank you

 

It seems you misunderstood what i meant and wrote.

  • Love 2
Link to comment
  • 0
2 hours ago, terrorr said:

Reboot comand it's just if necessary or maintenance !

"shutdown -r now" enough !

reboot is rebooting the machine.

You dont need to reboot the machine just to restart the server.

Consider the dedicated as your home pc, you dont restart it everytime you want to restart your browser do you? Its the same thing here.

Link to comment
  • 0
15 hours ago, DarkFire said:

Hi , devs . After reboot , on my server the time is going back. How to repair this?

Hidden Content

    Give reaction to this post to see the hidden content.

Read FreeBSD Setup Timezone

14 hours ago, DarkFire said:

Ok , when i want to make reboot i will do this , but what i need to do if server crush or are some problems with host company? In that case players will lose items..

Use Aria storage engine or InnoDB for your tables.

https://metin2dev.org/board/index.php?/topic/11831-install-mariadb-instead-mysql/

 

Link to comment
  • 0
  • Honorable Member

killall game will trigger the core shutdown event, and it will take at maximum 300 seconds to save all (items, players) and then stop the game. (without - is -1 by default, -9 will force the closure losing items; e.g. killall -9 game db)

After that, you can kill db.

Don't ever use reboot to restart the server. It will restart the server without stopping any process. It could corrupt mysql's database as well.

You should use shutdown -r now to restart. It will wait until all the processes are stopped. It usually takes 1 second though. Don't use it to safely stop metin2 since you need to stop the game cores before db, and not randomly.

Edited by martysama0134
  • Love 3
Link to comment
  • 0

- First: shutdown from game

- Second: killall game

- Third: wait 10 min and killall db

The following does not work. I always lose my items (i got those items executing /i xxx)

Link to comment
  • 0
  • Engineer
11 hours ago, Yasuke said:

- First: shutdown from game

- Second: killall game

- Third: wait 10 min and killall db

The following does not work. I always lose my items (i got those items executing /i xxx)

Just wait for the cache to propagate (max 7 minutes). If you want to be extra sure, just shutdown the server (you can kill the auth process), wait 7 minutes, then kill the proccesses and restart it.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.