[INACTIVE][ADMN] AutoStop v0.53 - Time-Based Server Shutdowns and Restarts [531]

Discussion in 'Inactive/Unsupported Plugins' started by dv90, Mar 6, 2011.

  1. Offline

    dv90

    Server AutoStop
    Time-Based Scheduled Server Shutdowns and Restarts
    I no longer support this plugin as I don't have the time. Sorry. Plugin devs. can edit the source and release it as they want. The current version is somewhat functional on some systems but not others.

    Version: v0.53
    Source: v0.53
    Requirements: Permissions v2.0/2.5+ (Optional)

    A simple plugin that saves player and chunk data then shuts the server down at a specified time.

    The plugin will automatically put AutoRestart.jar in your bukkit directory.
    Don't run it; it won't do anything.
    Do not delete or move it.
    If your server doesn't auto restart, post your restart_log.txt here.
    If there is no restart_log.txt, you're doing it wrong.
    If you use a .bat file (server_nogui.bat), set your path to: path=start server_nogui.bat

    NOTE TO ANYBODY USING AN EXTERNAL SERVER:
    Remember, your server's timezone may be different. Take that into account when setting up your autostop.properties.

    Features:
    • Saves Player Data
    • Saves Chunk Data
    • Gives a custom warning at specified time before shutting down
    • Quickly shuts server down
    • Uses autostop.properties to specify what time (24-hour clock) it should shutdown at
    • Automatically creates the properties file if it doesn't exist
    • Automatically restarts server (if you enable it)
    • Multiple restart times
    Changelog (open)

    Version 0.53 (Current)
    • Fixed a few small bugs
    • Kicks all players before shutting down
    • Updated to latest RB
    Version 0.52
    • Supports multiple warn times now
    • Other small fixes
    Version 0.51
    • Fixed a small problem with the syntax of the auto-generated autostop.properties file.
    Version 0.5
    • Multiple stop/restart times
    • Added better support for Windows cmd users
    Version 0.4
    • /reboot and /restart commands
    • Permissions support for commands
    Version 0.3
    • Automatic server restarts
    • Stop/Warn time precision works with seconds now
    Version 0.2
    • Added configurable warning message and warning time
    • Attempted automatic restarts but had no luck; possible in a future release
    Version 0.1
    • Release

    FAQs (open)

    Don't use permissions? Just OP yourself.

    What is the permission? autostop.use


    Commands:
    • /reboot - Immediately saves data and restarts the server.
    • /restart - Same as reboot.
    Properties Example:
    Code:
    stoptime=12:00:00 12:05:00 12:10:00
    # Use 24-hour time. Separate times with a space. [Hour:Minute:Second]
    warntime=0:10 0:30 1:00 5:00 15:00
    # Displays warning this many min:sec before shutting down. Separate with space. [Minutes:Seconds]
    warnmsg=Shutting down...
    # Warning message to display.
    enablerestart=true
    # Enables automatic server restarts. If this is true, path must not be blank.
    path=java -jar craftbukkit.jar
    # Path to server file (including any arguments). This can also be a command if you are using crontab/screen/etc.
    # Linux screen example:
    # path=screen -dmS MinecraftServer java -jar craftbukkit.jar
    
    Suggestions and feedback appreciated! :)
     
  2. Offline

    Oifan

    @dv90: I wish you less stress and good luck with your SAT, study should come before bukkit plugins :)

    Yes it's the same problem I have encountered -- see my posts with code for solution (if you know how to edit & compile Java source), or wait for next release...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 11, 2016
  3. Offline

    ledhead900

    This needs updating for 556+
     
  4. Offline

    Scipione

    This Plugin saves my day and works really fine. Thanks for this :)

    Just a lil question: The timestamps in the java windows are not correct, for example: my systemtime is 19:50 but the timestamp in the command-window shows 13:20
    Anyone a hint how to fix this ?
     
  5. Offline

    Afforess

    I've forked AutoStop and updated it. This new version will work on all builds of Bukkit, greater than ~300. It will work on the current RB, and even all of the development builds. It should work for a long time, unless bukkit changes how onCommand works.

    Additionally, you can issue restart commands from the console. Further, Autostop now stops all plugins before shutting down the server, which is vital, since many plugins save on shutdown, and autostop did not give them a chance to save valuable data.

    Here you go: http://dl.dropbox.com/u/49805/Autostop.jar

    Source: https://github.com/Afforess/Server-AutoStop
     
  6. Offline

    Oifan

    That is all nice, Afforess, but you are repeating the same bugs -- I already reported them here:
     
  7. Offline

    Afforess

    Did not even realize there were known bugs, just wanted to get it working again. Since it's on GitHub, you're free to open issues/pull requests.
     
  8. Offline

    godgodgodgo

    THANKYOU!!!!!!


    my start bat file is called "start.bat" and in the properties file I have "path=start.bat"
    Is this correct?
    When the plugin shuts down and restarts the old server cmd window is still open so it gives the 'could not start server, is it running on the same port?' error.

    Can you fix it so that it actually closes the old server window?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 11, 2016
  9. Offline

    Oifan


    I don't use Git, since the Windows port has some problems connecting to repository -- I tried msysGit from Google (both portable and standard) and apart from the fact that it's a total mess of scripts and duplicate binaries, it was freezing when connecting to a repository. So I assume it requires some non-trivial time to play with Git on Windows to make it work smoothly, and I like Bazaar more than Git :)
    IMHO the only advantage of Git is the same as of MS IE -- it's almost everywhere (at least every craftbukkit plugin project is on some GitHub). That does not necessarily mean it's the best DCVS tool ever.

    So maybe in half a year or so when I will have so much free time that I wouldn't mind wasting it on playing with Git, then I will "be free to pull requests" :)
     
  10. Offline

    Afforess

    I use TortoiseGit on windows for development, hassle free. But I'll look at implementing your fixes myself, thanks for bring them to my attention.
     
  11. Offline

    Oifan

    Wow, I use TortoiseSVN and once I used TortoiseCVS, but I didn't know there is also TortoiseGit. Thanks for the tip, Afforess :)
    Maybe I try it in a week or so, improving some CB plugins seems to be challenging...
     
  12. Offline

    ledhead900

    Thanks for updating this.

    When do those fixes for the time interval since it wont let me give more warn times.

    Could it be possible to also include the ability to close the shell window when it has finished stopping the server.

    Right now I have a cmd window open every time it restarts.
     
  13. Offline

    Scipione

    You can "fix" this by yourself.
    Just add at the .bat file, you are starting your server with, "exit" in the last line and force autostop to call this .bat file for server starting. Then the exit will close the window for you after the server was stopped.
     
  14. Offline

    ledhead900

    Yea I just forgot you could use it to start .bat files thx
     
  15. Offline

    crazydog

    Can someone update this to work with build 600? :D
     
  16. Offline

    Afforess

  17. Offline

    crazydog

  18. Offline

    Afforess

    Yes it will. I'd bet money it will still work through build 750.
     
  19. Offline

    Exone

    hmm, I'm not all that into unix or terminal, I'm using putty(puttytray to be exact..) on a W7 machine to control my server.
    I'm using screens, and it works well. But when there's a restart, it doesn't start in the same screen or a new screen.

    How could one accomplish this?
    I got one screen running in putty, and I want the server to re-attach to that screen on reboot/restart.
     
  20. Offline

    Oifan

    Exone, it seems you mix things. There is the server with operating system - Linux/Unix. There is program screen running on it. Then there is bukkit.jar running on it. The PuTTY does NOT run on the server, it's a client-side program (on server side, you have usually sshd listening on TCP port 22).
    Now, the easiest way of achieving what you want, is following these steps:
    1. connect to your Linux/Unix server (using PuTTY or something similar)
    2. run screen -D -RR (which means: Do whatever is needed to get a screen session)
    3. from screen, run server.sh
    4. to log off the server, press Ctrl-A D, then Ctrl-D (or type logout)
    5. to log in back to screen (after you log on to server), run screen -D -RR
    6. to restart the server manually, just type "stop" in the console
    server.sh may look like this:
    Code:
    #!/bin/bash
    while true; do
      java -Xmx2048M -Xms2048M -Dfile.encoding=UTF-8 -jar craftbukkit.jar nogui
      sleep 15
    done
    
    Or if you want to add some common libraries (like lib/sqlite.jar), you can use this instead "-jar craftbukkit.jar":
    Code:
    -cp lib/sqlite.jar:craftbukkit.jar org.bukkit.craftbukkit.Main
    With this configuration, you just set
    Code:
    enablerestart=false
    in plugins/AutoStop/autostop.properties, because server.sh will start the craftbukkit server after each shutdown for you.
    That's all.
     
  21. Offline

    Exone

    I'm aware that putty isn't running on the server machine :p
    I did not however, think of sleep as a simple solution ><'
    But since there is a line for custom command, (mentioning screen) I just blindly thought it was possible, thou, your method seem a lot better, and smoother.
    (My post made it look like I'm sitting with PuTTY running on another machine all day lawl)

    Haven't made alot of .sh scripts at all lawl.
    I feel like a total noob for not being able to accomplish this without help xD

    Thanks for your help!
    It should work :D
     
  22. Offline

    PatrickFreed

    Could you keep developing it as one of your plugins?
     
  23. Offline

    leslieliang

    Update for 617 please!
     
  24. Offline

    crazydog

  25. Offline

    leslieliang

  26. Offline

    unenergizer

    Are there any alternatives to this? This isn't displaying the restarting message, the time left, closing the plugins first, and its not restarting the server. I could really use something like this to restart my server every 4 hours or so.
     
  27. Offline

    leslieliang

    When the server restarts, it crashes. Why?
     
  28. Offline

    ledhead900

    I think I see the Issue currently I'm using Afforess build about to change since we REALLY need this more then ever now that 1.4 MC has a lovely habbit of locking up the server after some time of use.

    Here is what I can get from the issue.

    When server restarts it starts a .bat file for me this in turn starts my server the Issue I'm having is that it's not leaving enough time for the server to fully close before trying to start a new instance.

    This as you would guess starts a server with the "Port is not available"
    I't seems plug ins like WAR1.4 also stop the plug ins on shut-down so that's not a real issue but it does add a good 30 seconds to shutdown time.

    What I suggest in fact I'm making it a Request that next time someone forks this please add the ability to delay how long to wait until trying to start the server again.

    I'm not sure If I can delay starting a bat file with CMD, As clever as I am I have never tried I will google this to find out tho.
     
  29. Offline

    Jorrdan

    During the last auto restart, it tried to reboot the server too fast and gave me "servers already running on that port" message. Please introduce a configurable restart time. So instead of 2.5 seconds beteween saving chunks to new instance we can make it 30 seconds or even 1 minute just incase.

    Thanks
     
  30. Offline

    Scipione

    the command window shows the wrong time, system time is fine. Any hints ?
    Thanks :)
     
  31. Offline

    ledhead900

    Try this while its crude in a away it works just fine :p, I made it especially to combat this nonsense.
    http://forums.bukkit.org/threads/winos-minecraft-delayed-server-starter-tame-your-restarts.11690/

    What actually happens is it tries to start a new instance of the server little too soon if your server runs a lot of plug-ins or is slow to shutdown, I found that autostop will start a new instance before the existing one has shut down.

    Anyway hope my little tool helps.
     

Share This Page