Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Other ways to auto-restart a server

Comments in 'Plugin Development' started by Gamecrafter, Sep 13, 2015.

?

How do you get your server to automatically restart?

  1. Modifying start.cmd/start.sh

    64.3%
  2. Other methods

    35.7%
  1. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Hello, everyone. I would like to ask if there are any other ways to auto-restart a server. I've heard there are other ways to restart it(without having to modify start.cmd or start.sh), but I haven't heard how. So can anyone tell me the other methods to auto-restart a server? I have a hunch that it has to do with scripts(obviously). Thank you for reading. :)
  2. andre_the_gamer
    Offline

    andre_the_gamer Active Member

    Joined:
    Feb 5, 2015
    Posts:
    112
    Minecraft User:
    Andre_The_Gamer
    There is a script you can make and name it AutoRestart.sh and the script will detected query udp,tcp port: 19132 and if no connection from the port it will automaticly run Pocketmine start.sh :) You can modify the server port by editing the script :D
  3. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    If you could show me the script that would be great. Or else I'll just assume it's not real.
  4. andre_the_gamer
    Offline

    andre_the_gamer Active Member

    Joined:
    Feb 5, 2015
    Posts:
    112
    Minecraft User:
    Andre_The_Gamer
  5. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
  6. andre_the_gamer
    Offline

    andre_the_gamer Active Member

    Joined:
    Feb 5, 2015
    Posts:
    112
    Minecraft User:
    Andre_The_Gamer
    You can make a script that Query udp, 19132 and if it doesnt get response from port it automaticly run the start.sh
  7. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    I use the Multicraft Panel x) so just do /stop and the server restart.
  8. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    I'm talking about auto-restart, not manual.
  9. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Just do a plugin, every hours the server restart .

    Or cron job maybe ?
  10. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    More seriously:
    Why not a script which check if the server is online, if it's offline, it launch the server.
    And another which close the server with a defined delay, like 1 hour.
  11. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    I already have a plugin that restarts it, but is there any other way to restart a server without having to modify start.cmd or start.sh?
  12. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    Maybe use my query api to check if the server is online or not and
    lauch a shell command.
  13. wies
    Offline

    wies Notable Member

    Joined:
    Aug 23, 2013
    Posts:
    390
    To just loop the start script, use the -l option:
    Code:
    ./start.sh -l

    If you want to restart a server after some time in linux, use this command:
    Code:
    while :; do timeout 30m ./start.sh; done
    
    in this example it restarts every 30 minutes.
    Last edited: Sep 13, 2015
    Andrey Nazarchuk and Falk like this.
  14. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    Will that wait for pocketmine to stop safely and drop its memory?
  15. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    He dont't want modify the start.sh
  16. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    Dude please you literally don't understand what anyone is talking about, @wies said "use this command"
    andre_the_gamer likes this.
  17. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Why can't you simply use TimeCommander to stop the server?
    Andrey Nazarchuk likes this.
  18. Asparanc
    Offline

    Asparanc Active Member

    Joined:
    Feb 20, 2015
    Posts:
    210
    Minecraft User:
    Asparanc
    He want restart it, TimeCommander will only stop it.
  19. da123rrell
    Offline

    da123rrell Active Member

    Joined:
    Feb 11, 2015
    Posts:
    136
    Minecraft User:
    da123rrell
    i don't think there is a way...
  20. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse

Share This Page

Advertisement