Skip to main content

Thread: Trying to get a java program to restart when it crashes


thanks in advance reply.

i'm relatively new linux , trying run minecraft server. got server running fine recent pre-release bit unstable. such, crashes often.

read that there ways ubuntu run called "bashscript" (i'm guessing it's .bin on ***dows) automatically check if program running, , start program if not running. problem can't make heads or tails of code...

can me code out?

figured out

it's more complicated typing text in terminal unfortunately, follow instructions:

  1. create document following code (anywhere on machien)
    code:
    #!/bin/bash  while true if [ ! `pgrep java` ] ; /usr/bin/minecraft.sh fi sleep 30 done
  2. create document in minecraft server folder , title "start server.sh" following code
    code:
    cd /home/kenji_03/games/minecraftserver java -xms1g -xmx1g -jar minecraft_server.jar
  3. <important> must change "change directory" (cd) portion direct terminal minecraft server folder
  4. make link "start server.sh"
  5. copy it
  6. go /usr/bin root user (you can use terminal's "sudo nautilus" browser gui).
  7. paste link , rename "minecraft.sh" (case sensitive)
fair warning, code depends on server being java app running on computer. won't able use other java app while running -- sorry!


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] Trying to get a java program to restart when it crashes


Ubuntu

Comments

Popular posts from this blog

Joomal 3.6.3 update error - PHP temporary folder is not set - Joomla! Forum - community, help and support

Upgrade 3.4.8 to 3.5.1 failed "download package failed" - Joomla! Forum - community, help and support

Fatal error during instalation - Joomla! Forum - community, help and support