Stop Server On Crash

Discussion in 'Archived: Plugin Requests' started by daboross, Nov 16, 2012.

  1. Offline

    daboross

    I know this is a strange request but...




    Plugin category: Maintenance

    Suggested name: TimeOutServerKill

    What I want: I have been kind of annoyed when the server crashes, but the process stays alive, and thus I cannot use bash commands to tell if it is still running.
    I would like to have a plugin that will kill the server process if players can no longer connect to it, EG: when it crashes because of something like a tick loop, or when it times out.

    All the plugin would do is save the world, then kill the server when it times out. So whenever the server would say "read time out" this plugin auto-saves the world, then auto-kills the server. I don't need it to restart the server, just kill it.

    I don't need any Permissions or Commands.

    When I'd like it by: The 1.4.5 update? That is probably a little to demanding, so, as soon as possible.

    If anyone would be able to create this, I would be very grateful. And 1.4.5 compatibility would be helpful.
     
  2. Offline

    daboross

    So either no one is able to do this, or no one is interested?
    I guess this is a bump... I do not think that is against the rules, I just read them.
     
  3. Offline

    TheSkeletonSK

    Try looking into NoLagg (can identify a crash so you can fix it) and RemoteToolkit (forces save and restarts the server upon most crashes, or if the server doesnt respond in a certain amount of time.)
     
  4. Offline

    wacossusca34

    This would have to have either native method calls or OS commands executed by the plugin to successfully kill the server. When the main thread is completely frozen, a System.exit(int arg) isn't going to work. Unless there's a special way in Java to get the process to kill itself, I'm pretty sure you would have to execute a command depending on the OS.

    However, this is possible. You could have your plugin running a scheduler all the time, working with a separate thread, and if the scheduler doesn't respond to the separate thread for like 30 seconds, the server would close, and possibly, start back up ;)

    Just an idea. I might explore this tomorrow, I'm pretty tired right now.
     
  5. Offline

    daboross

    I would much prefer not to get any of those other features, but I will look into those.


    I think that would probably work, except for one case that I have had. Once or twice my server has crashed, displayed all the errors, then kept on running. All the plugins and commands were still functioning, it just stopped players from joining. In that case a plugin like this wouldn't detect it, would it?
    Anyways that seems like a good plan, if you would do that I would be grateful. Running a bash command like killall -9 java. I do use ubuntu.
     
  6. Offline

    wacossusca34

    Yeah, this would only work if the main thread becomes unresponsive. However, if players can't join your server, but your plugins seem to be running, I would assume the main thread is frozen. Everything is still running when the main thread is frozen, and even some method calls would work outside the main thread. That means plugins that operate of separate threads (not many) will still be semi functional.

    And good for running Linux. I'l do this after school today.
     
  7. Offline

    daboross

    That would be awesome! Thank you in advance.
     

Share This Page