Jump to content

Time back after reboot


Recommended Posts

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

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

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?

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

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
Share on other sites

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

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • 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.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 2
Link to comment
Share on other sites

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
Share on other sites

15 hours ago, DarkFire said:

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

https://www.cyberciti.biz/faq/howto-set-date-and-time-timezone-in-freebsd/amp/

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
Share on other sites

  • 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 5
Link to comment
Share on other sites

  • 4 years later...
  • Forum Moderator
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.

Gurgarath
coming soon

Link to comment
Share on other sites

  • 2 years later...
On 1/23/2017 at 1:24 PM, martysama0134 said:

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.

so let me understand that the things that tell the truth about certain things are deleted and you try to cover them up, I didn't think so, I wrote something and the mass was deleted, I think it should have been left there for everyone to understand that there are things that do not have the same functions

Link to comment
Share on other sites

  • Honorable Member
5 minutes ago, VirusS said:

so let me understand that the things that tell the truth about certain things are deleted and you try to cover them up, I didn't think so, I wrote something and the mass was deleted, I think it should have been left there for everyone to understand that there are things that do not have the same functions

"reboot" now is "shutdown -r now". They changed the behavior in the last 7 years 🤣

Edited by martysama0134
  • Not Good 1
  • Lmao 1
Link to comment
Share on other sites

  • 3 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 4

      Feeding game source to LLM

    2. 0

      Quest 6/7 Problem

    3. 5

      Effect weapons

    4. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    5. 3

      Crystal Metinstone

    6. 4

      Feeding game source to LLM

    7. 113

      Ulthar SF V2 (TMP4 Base)

    8. 4

      Feeding game source to LLM

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

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.