Inactive [ADMN] SimpleRestart v1.1.0 - Simple server [automatic] rebooting and commands [1000]

Discussion in 'Inactive/Unsupported Plugins' started by FuzzyWuzzie, Jul 4, 2011.

  1. Offline

    Shadowlauch

    I found the Bug. The yml file was corrupt, but i didn't changed much.
     
  2. Offline

    Lying_Cake

    So where do I put the start code? I manually start my server with the command "java -Xms1024M -Xmx2560M -jar craftbukkit.jar nogui" and I cannot get the LaunchServer.command as suggested by Bukkit to work (It says i do not have sufficient access priviliges, even though im admin and the "get info" says everyone can read & write). I have a Mac running 10.6.7.

     
  3. Offline

    FuzzyWuzzie

    @ibab I honestly have no idea what is causing those issues. I have not been able to replicate a single one of those bugs, and have gone through the source with a fine-tooth comb and still come up empty-handed. Would you mind telling me all the plugins you have installed so I can try to figure it out?

    @Beldrama If you modify your startup script (even without using this plugin) to contain an infinite loop around the "java -jar craftbukkit.jar" line, then it should automatically restart your server every time it goes down (without you needing to be there!). Unfortunately, there is no way to reboot the server from within itself - it requires external help. You also might want to take a look at RestartNow - that plugin uses an external java program to reboot the server, I believe (whereas mine just uses a minor shell script modification).

    @icychicken5 yes, like zook said, you can use the linux-style infinite loop in the startup script

    @zookalicious thanks man!!

    @Lying_Cake Do something like this:
    1. Create a file called "start.sh" in the same directory as your craftbukkit.jar
    2. Insert the following into that file:

      Code:
      #!/bin/sh
       while true
       do
           java -Xms1024M -Xmx2560M -jar craftbukkit.jar nogui
           echo "If you want to completely stop the server process now, press Ctrl+C before the time is up!"
           echo "Rebooting in:"
           for i in 5 4 3 2 1
           do
               echo "$i..."
               sleep 1
           done
           echo "Rebooting now!"
       done
    3. Save and close the file
    4. Run it by typing "sh start.sh" into the terminal.
    5. You should be good, but if "sh start.sh" does not work, you can try "chmod +x start.sh" to give the script executable permissions, then type "./start.sh".
    6. I don't actually have a mac that I can test any of this on, but from what I know, it should be more or less the same as linux. Let me know if you have any problems, and I'll see what I can do.
     
  4. Offline

    arnie231

    how do i add more ram to the server when ever i cange anthign it wont restart ? (windows OS)
     
  5. Offline

    Bannanas

    Help, when I run the linux screen command it just does
    1
    2
    3
    4
    screen terminated
    1
    2
    3
    4
    and so on.
     
  6. Offline

    yaitsbilly

    Simple and easy thanks :)
     
  7. Offline

    matjam

    lol, wish I had seen this before I wrote my plugin that does pretty much the same thing :)

    Ah well.
     
  8. Offline

    robsterr8

    jap the same here, it creates a endless loop starting infinite screen sessions and minecraft server which do not start because one is alread running, can you please provide us with a solution on that one? =)

    thanks in advance and cheers
    rob
     
  9. Offline

    FuzzyWuzzie

    @arnie231 add "-Xms1024M -Xmx1024M" in your java command line to give it 1 gig of ram (change numbers as you need)

    @Bannanas @robsterr8 The reason is does that is because the script is crashing. Make sure you have changed the appropriate directories and have appropriate names of things. The SIMPLEST (and probably the best) way of doing things would just be to open up screen manually yourself (as screen is meant to be used), then run the normal linux script in a window there. Think of screen as your "windows" for linux command line. If you're running screen every time you run your server, that's like rebooting your computer every time you want to play minecraft. Also, if you don't know the screen commands, I suggest you do so (such as attaching, detaching, etc).

    If you still want to run screen in the script, you can try this:

    start.sh:
    Code:
    #!/bin/sh screen -t "Minecraft" -S "Minecraft" bash -c "sh restart.sh 2>&1 | tee -a log.txt""


    restart.sh:
    Code:
    #!/bin/bash
    cd ~/mc
    while true
    do
            java -Xms1024M -Xmx1024M -jar craftbukkit.jar nogui
            echo "If you wish to completely stop the server process now, press Ctrl$
            echo "Rebooting in:"
            for i in 5 4 3 2 1
            do
                    echo "$i..."
                    sleep 1
            done
            echo "Rebooting now!"
    done
    This will start screen and run the restart.sh script, and log EVERYTHING to the text file log.txt, so you can catch any errors if screen kicks you back out immediately. Note that once you finally have things up and running, you probably don't want it to log everything, as if you leave a server up for a long time, you'll get a very large log.txt file (which will be largely the same as the minecraft log file).

    This should work, as I've tested the script and it works fine on my ubuntu server, but then again, so did the other scripts...
     
  10. Offline

    robsterr8

    i don't get it, whats wrong with this -> ?


    Code:
    #!/bin/sh
       while true
       do
          screen -t "MinecraftServer" -S "MinecraftServer" bash -c 'java -Xms2048M -Xmx2048M -jar Minecraft_Server.jar nogui ; exit'
          echo "If you want to completely stop the server process now, press Ctrl+C before the time is up!"
          echo "Rebooting in:"
          for i in 5 4 3 2 1
          do
                echo "$i..."
                sleep 1
          done
          echo "Rebooting now!"
       done
    i started my server with screen java -Xms2048M -Xmx2048M -jar Minecraft_Server.jar nogui
    and it resulted in this issue, and i started it with the above posted script named "minecraft.sh" with "./minecraft.sh" with executable rights, and it was the same ..

    my mc server ist named Minecraft_Server.jar and is in /home/minecraft, the script "minecraft.sh" is located in this directory, screen is installed ..
    i would love to do it like that because it's a lot more simple than the other method, and i want to have my server clean with less files as possible

    i appreciate your help, thank you very much
    cheers
    rob
     
  11. Offline

    Grrrr159

    When I use "Restart Now" from the console, it just stops the server, and doesn't turn back on.
    Nevermind, found the fix :) Great Plugin
     
  12. Offline

    Lying_Cake

    Hey thanks a lot it works great now!
     
  13. Offline

    yaitsbilly

    Server is not restarting anymore it goes into -10m now and lower.
     
  14. Offline

    robsterr8


    nobody any idea, why this isnt' working?
     
  15. Offline

    FuzzyWuzzie

    I am no Linux expert - you might want to try asking on a linux forum somewhere?
     
  16. Offline

    robsterr8

    i guess i'm not the only one who uses screen and linux, but i started a thread in a linux forum, we'll see if it works, when i have a working solution i'm gonna post it here

    cheers
     
  17. Offline

    harrisonduell

    Emm i have a problem or a slight question, the server bat opens as a cmd file? How do i get into the script?
     
  18. Offline

    Mapatti

    Right click and Open with... any texteditor or just press Edit.
     
  19. Offline

    alfskan

    server stop working well.

    but that`s all.

    It doesnt start server again! why??
     
  20. Offline

    FuzzyWuzzie

    @alfskan please read the installation and how to edit your startup script.
     
  21. Offline

    alfskan

    oh..Im idiot. I couldnt see that.

    Now It works.:)

    but.. "stop" makes restart server everytime. I cant really stop it :'(
     
  22. Offline

    kirtap1001

    I dont have mac but the one that host server for me has a MAC and he get som crashes and want to use this :) but he used this as start.sh
    Code:
    #!/bin/bash
    while true
    do
        screen -t "MinecraftServer" -S "MinecraftServer" bash -c 'java -Xms14000M -Xmx14000M -jar craftbukkit.jar nogui ; exit'
        echo "If you want to completely stop the server process now, press Ctrl+C before the time is up!"
        echo "Rebooting in:"
        for i in 5 4 3 2 1
        do
            echo "$i..."
            sleep 1
        done
        echo "Rebooting now!"
    done
    But When he had type "chmod +x start.sh" and after that "sh start.sh" he gets this when it loads...

    Code:
    Last login: Tue Jul 26 13:18:39 on ttys000
    iMac:~ pamtaggart$ cd ~/Desktop/Bukkit\ Server
    iMac:Bukkit Server pamtaggart$ chmod +x start.sh
    iMac:Bukkit Server pamtaggart$ sh start.sh
    'tart.sh: line 8: syntax error near unexpected token `do
    'tart.sh: line 8: `     do
    iMac:Bukkit Server pamtaggart$ 
    what could be wrong ?!
     
  23. Offline

    FuzzyWuzzie

    It looks like it doesn't like the internal do loop. This loop is optional, and just gives you a countdown before the server starts up again. Try removing the entire for...do...done stuff and see what happens.
     
  24. Offline

    kirtap1001

    So i could have it like this if i want?
    Code:
    #!/bin/bash
    while true
    do
        screen -t "MinecraftServer" -S "MinecraftServer" bash -c 'java -Xms14000M -Xmx14000M -jar craftbukkit.jar nogui ; exit'
    done
     
  25. Offline

    2kool250

    ok call me a noob but i have no idea what to do. im on a MAC and i run my server on a start.command file.
    if you could sell me exactly what i need to type or what i need to put into my start.command. what im wanting is for my server to retart while im away the server wont crash! if you could help it would be greatly appreciated!
     
  26. Offline

    2kool250

    if no one could help me you could have just said
     
  27. Offline

    wellaman5000

    im probalbly being a noob , i much click a key to make the server restart , any ideas?
     
  28. Offline

    decebaldecebal

    this is more like the /reload command than the /restart command because it doesn't actually restarts the server
    (it doesn't close the java.exe and the cmd window it just reload it)and the RAM isn't cleared
    i need it to close java.exe and then open it again
    does anybody know a startup script that does that when i write /stop or /restart?
     
  29. Offline

    itune

    Why doesn't this work for me?
    It works like /stop for me all it does is stop my server not restart.
    Please help!
     
  30. Offline

    TheBeast808

    This doesn't seem to be working with screens. It doesn't kill the previous one, but it starts a new one which, over time, leads to a giant shitstorm of screens.
     

Share This Page