Let your server know when to stop [Poll]

Discussion in 'Bukkit Discussion' started by bergerkiller, Oct 22, 2011.

?

Did you know you have to use /stop to stop the server?

  1. Yes, of course I do!

    92.1%
  2. No, but my server wrapper makes sure I do!

    4.2%
  3. No, is that important?!

    6.0%
Multiple votes are allowed.
Thread Status:
Not open for further replies.
  1. Offline

    jasvecht

    I use a wrapper to reboot it, but I still get to kill it 1 to 30 times a day. A few missing chunks but it's still rolling 6 months while doing it...




    Blame read timed outs blocking /stop, the wrapper and every other fricking way of ending it.
     
  2. Offline

    Pheenixm

  3. lol, this was like a week after you screwed up my server Jason. so it wasn't you.
     
  4. Offline

    bergerkiller

    Actually, I have my own type of server wrapper built for debugging. I added a single 'stop' button. The first time it is clicked, it invokes /stop. The second time it simply kills the process. This way I can click on that button and click again if I managed to make the server freeze again.. :p

    It's no problem if you kill the process for debug purposes (there is no other way), but don't make it a routine thing. :)
     
  5. Offline

    Lunar Delta

    I always do a save-all first, then stop, because I am paranoid like that.
     
  6. Offline

    ashtheking

    The [x] sends a System.exit(int) to the virtual machine, right? Just use System.addShutdownHook(Thread) and run the code of the /stop command in the thread. If the user uses /stop, just have it System.exit(0), so it'll call the shutdown hook and save everything and whatnot.
     
  7. Offline

    bergerkiller

    @ashtheking that is what I heard as well, but never really seen it in action in Bukkit. Could be they added one just now, of course. Problem is that it is a process, so when you click [x] on a console, it kills any process within. (think of CMD, no shutdown hook there either for tools running inside, [x] is gone)

    I believe the shutdown hook is only useful for when the OS decides to shut down all of a sudden.
     
  8. Offline

    Evangon

    Something random I wanted to add to how you stop your server :3
    Take out the RAM :D
    It's more fun watching your computer and server error :3
     
    efstajas likes this.
  9. lol, that is a fun way to stop your server, i might try it some time...
     
    efstajas likes this.
  10. Offline

    mindless728

    hell while you are at it throw it into a pool while it is on, that should do the trick of corrupting the map
     
    tyzoid and efstajas like this.
  11. Offline

    EndHumanity

    I cringed when I read this.
    This reminds me of how the tech coordinator at my high school decided to pull the RAM on a computer without turning it off first.

    Anyway, I would be surprised if people didn't know to use /stop, but I guess some are out there.
     
  12. Offline

    mindless728

    i would guess more than some as we have a lot of people in bukkit help with corrupted chunks in there map save files
     
  13. Offline

    Xenarthran

    If this is such a problem couldnt the developers of bukkit add a java code where pressing the X button does nothing? it only takes one or two lines of code.
     
  14. Offline

    bergerkiller

    @Xenarthran it's impossible for a process to handle the event if the process is killed, which happens when clicking the X. Otherwise viruses could prevent themselves from getting closed by starting an infinite while loop, get the idea?
     
  15. Offline

    Xenarthran

    for a window called testWindow

    testWindow.setDefaultCloseOperaion(JFrame.DO_NOTHING_ON_CLOSE);

    what would this do?
     
    tyzoid likes this.
  16. Offline

    Bertware

    I have written a .NET GUI for bukkit. (link in signature)
    My GUI forces you to use a stop command. If you close the GUI (clicking on the X, using Close command from tray Menu,...), The close is cancelled and a Stop command is being sent. Once the server is stopped, The GUI closes.
    The only way to shutdown the server/GUI without sending a stop command, is killing the process in the task manager.

    Quite easy to prevent your application from quitting (.NET):
    Code:
    private sub DontClose(sender as object,e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
    e.cancel = true
    end sub
    I guess every GUI or Wrapper contains functionality as described above.
    It takes 1-3 lines to prevent the form from closing.
    The whole shutdown code is more complex.
     
    tyzoid likes this.
  17. Offline

    Xenarthran

    Wow your GUI makes it a lot easier to admin, glad to know i won't accidentaly corrupt my server again :)
     
  18. Offline

    bergerkiller

    @Bertware I got that too, but that's called a server wrapper, see the poll:
    No, but my server wrapper makes sure I do!
    I am talking about consoles here, those started in batch. (since most people don't want a GUI running to boost performance)

    My wrapper even allows me to stop the server, and the next time it's clicked it kills the process. Plain and simple, and perfect for debugging on a commonly frozen server :)
     
  19. Offline

    Lolmewn

    This is such a pro-thread :D
    Especially the first +- 7 posts :D
     
  20. Offline

    Bertware

    A bit Offtopic:
    there are more then 10 wrappers available, I guess everyone can find one that matches their needs (or write hem one themselves)
    Wrappers don't reduce server performance. They only take some Ram, and some CPU (fixed mine on +-0%CPU and 30MB RAM, i think the other .NET GUI's alos have similar resource usage)
    My GUI actually boosts my server performance ^^ (if 64bit is enabled)

    I guess frozen servers are really common for you, if you place a kill function at such easy place :p

    Java should have such a function too (to detect closing window).
    Could be handy if the close button could be linked to a command :)
     
  21. Offline

    bergerkiller

    @Bertware that's more of a task for Windows' console (cmd.exe) to do that, since Java has no control over the console. (it can merely read and write text from/to it)
     
  22. Offline

    ipaqmaster

    I have FireDaemon manage my server. it makes it /stop before shuting it down (every midnight) and then simply starts it every 5am morning. =)

    You can't have a good server (that you expect to have keep up with people) without a SSD or ramdisk ^_^.
    Sure internet speed is one check but imagine how many times it has to write to a disk (especially if you have spin down activated)

    Just thought that would be a neat sub topic to bring up =P
     
  23. Offline

    Afforess

    bergerkiller - this is something bukkit could fix actually, java allows processes to register shutdown hooks to execute last minute code when an application closes. This only DOESN'T work when power fails.
     
  24. I usually call the electric service and tell them to turn off the power in the street, so i can make sure my server is stopped! :D
     
  25. Offline

    LEOcab

    LOL. Noobs running servers. XD

    I always do /kickall /save-all /stop.

    The guy who doesn't use backups... You gonna cry, boy. Btw I use cron-jobs to save-all every 5 minutes, rsync backups hourly, and svn backups daily.
     
  26. Offline

    kickbutt101

    I never put my server down xD I just restart it on the command line or I just reload it with AdminCMD XD
     
  27. Offline

    grant1222

    I ALWAYS use /stop. I have had times where by muscle memory I click the X, and sometimes I got lucky and it saved sometime before it, but other times I lost a LOT of work. Always use /stop, unless you have an auto saving plugin that saves often.
     
  28. Offline

    XanderCrews01

    Entertaining stuff here. I look forward to more threads like this.
     
  29. Offline

    Jade

    Youre ALL mediocre! I just remove the processor, throw it in the ocean, pull it back out, and send it to zimbabwe to be colocated!

    On certain occasions, I simply delete the folder 'Minecraft' In /root/ !
    And Maybe, just maybe, ask my host to delete the whole OS before I back it up!
     
  30. Offline

    weltallofid

    Most of the time I was hosting a server I would hit the X button until I remember I read in one of the installation guides the "type /stop". Lol I never had a problem up to that point and actually even up to today I would forget to use /stop and just use save-all and X, I guess I am used to it. But now I am using The Bukkit GUI and since I see the stop button I never forget that I should use that XD

    Also if I wanted an extreme way to turn off my PC I would just punch and hit the tower until it would stop.. cause it does that if I hit it hard when I get mad with the noise the stupid 1TB WD Black Caviar does. Always works :)
     
Thread Status:
Not open for further replies.

Share This Page