How to setup a Ubuntu CraftBukkit Server (x64) running Java x64

Discussion in 'Bukkit Help' started by TnT, Jan 15, 2011.

  1. Offline

    TnT Retired Staff

    My BukkitDev Profile
    My Plugins (2)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Xms is the starting value for the heap size. I doubt you'll see much of a difference unless the server actually needs that many GB of heap space right off the bat. You can play with that value or remove it all together - the only time you'll see a performance difference is on freshly starting the server.
     
  2. Offline

    LinkterSHD

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Really USEFUL thank you so much TnT
     
  3. Offline

    palisade

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I use the following runmc script to launch craftbukkit.jar. It lets you start, stop, grab an update, backup, or run commands in the background via screen on your server without an interactive terminal open. It'll even handle saving the world and turning off world saves before backing up, and then turning it back on afterwards. Rename your craftbukkit-v-v-RCn.jar to just craftbukkit.jar for this script to work. The update even verifies if the website has a new jar available or not before bothering to update.

    Also anywhere where it says /home/palisade/mc point it to your minecraft directory instead, and set USERNAME to the user you run mc as. In addition make sure BACKUPPATH is set to a location you store backups, preferably one that is backed up on a remote drive. That way if the platter in your server fails you have a remote backup of the worlds. You could call `runmc backup` in a cron job at a certain interval to back up the world (e.g. every 30 mins), and maybe change the cp line to a zip, bzip2 or 7z if you want to save space. You might need to add additional worlds, like the world-nether directory, this script only handles the main world.

    I've set java to use 2gb, you might want to adjust this to your personal preference. Also, my server had 4 cores, so you'll want to adjust the CPU_COUNT. Anywhere that says mcserver is the screen session name, if you want to change that.

    I rewrote the original script for this from minecraft's wiki to work with bukkit:
    http://www.minecraftwiki.net/wiki/Server_startup_script

    I wanted to put this up on bukkit's wiki but the page was locked, so I'm posting it in the forum instead. Enjoy! Hope it helps. :p

    Code (Text):
    1. #!/bin/bash
    2. # /home/palisade/mc
    3. # version 0.3.6 2011-10-17 (YYYY-MM-DD)
    4.  
    5. ### BEGIN INIT INFO
    6. # Provides:  minecraft
    7. # Required-Start: $local_fs $remote_fs
    8. # Required-Stop:  $local_fs $remote_fs
    9. # Should-Start:  $network
    10. # Should-Stop:    $network
    11. # Default-Start:  2 3 4 5
    12. # Default-Stop:  0 1 6
    13. # Short-Description:    mc server
    14. # Description:    starts mc server
    15. ### END INIT INFO
    16.  
    17. #Settings
    18. SERVICE='craftbukkit.jar'
    19. OPTIONS='nogui'
    20. USERNAME='palisade'
    21. WORLD='world'
    22. MCPATH='/home/palisade/mc'
    23. BACKUPPATH='/home/palisade/mcbackup'
    24. CPU_COUNT=4
    25. INVOCATION="java -Xmx2048M -Xms2048M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=$CPU_COUNT -XX:+AggressiveOpts -jar $SERVICE $OPTIONS"
    26.  
    27. ME=`whoami`
    28. as_user() {
    29.   if [ $ME == $USERNAME ] ; then
    30.     bash -c "$1"
    31.   else
    32.     su - $USERNAME -c "$1"
    33.   fi
    34. }
    35.  
    36. mc_start() {
    37.   if  pgrep -u $USERNAME -f $SERVICE > /dev/null
    38.   then
    39.     echo "$SERVICE is already running!"
    40.   else
    41.     echo "Starting $SERVICE..."
    42.     cd $MCPATH
    43.     as_user "cd $MCPATH && screen -dmS mcserver $INVOCATION"
    44.     sleep 7
    45.     if pgrep -u $USERNAME -f $SERVICE > /dev/null
    46.     then
    47.       echo "$SERVICE is now running."
    48.     else
    49.       echo "Error! Could not start $SERVICE!"
    50.     fi
    51.   fi
    52. }
    53.  
    54. mc_saveoff() {
    55.   if pgrep -u $USERNAME -f $SERVICE > /dev/null
    56.   then
    57.     echo "$SERVICE is running... suspending saves"
    58.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"say SERVER BACKUP STARTING. Server going readonly...\"\015'"
    59.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"save-off\"\015'"
    60.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"save-all\"\015'"
    61.     sync
    62.     sleep 10
    63.   else
    64.     echo "$SERVICE is not running. Not suspending saves."
    65.   fi
    66. }
    67.  
    68. mc_saveon() {
    69.   if pgrep -u $USERNAME -f $SERVICE > /dev/null
    70.   then
    71.     echo "$SERVICE is running... re-enabling saves"
    72.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"save-on\"\015'"
    73.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"say SERVER BACKUP ENDED. Server going read-write...\"\015'"
    74.   else
    75.     echo "$SERVICE is not running. Not resuming saves."
    76.   fi
    77. }
    78.  
    79. mc_stop() {
    80.   if pgrep -u $USERNAME -f $SERVICE > /dev/null
    81.   then
    82.     echo "Stopping $SERVICE"
    83.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"say SERVER SHUTTING DOWN IN 10 SECONDS. Saving map...\"\015'"
    84.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"save-all\"\015'"
    85.     sleep 10
    86.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"stop\"\015'"
    87.     sleep 7
    88.   else
    89.     echo "$SERVICE was not running."
    90.   fi
    91.   if pgrep -u $USERNAME -f $SERVICE > /dev/null
    92.   then
    93.     echo "Error! $SERVICE could not be stopped."
    94.   else
    95.     echo "$SERVICE is stopped."
    96.   fi
    97. }
    98.  
    99. mc_update() {
    100.   if pgrep -u $USERNAME -f $SERVICE > /dev/null
    101.   then
    102.     echo "$SERVICE is running! Will not start update."
    103.   else
    104. #    MC_SERVER_URL=http://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar?v=`date | sed "s/[^a-zA-Z0-9]/_/g"`
    105.     MC_SERVER_URL=http://dl.bukkit.org/latest-rb/craftbukkit.jar
    106.     as_user "cd $MCPATH && wget -q -O $MCPATH/craftbukkit.jar.update $MC_SERVER_URL"
    107.     if [ -f $MCPATH/craftbukkit.jar.update ]
    108.     then
    109.       if `diff $MCPATH/$SERVICE $MCPATH/craftbukkit.jar.update >/dev/null`
    110.       then
    111.         echo "You are already running the latest version of $SERVICE."
    112.       else
    113.         as_user "mv $MCPATH/craftbukkit.jar.update $MCPATH/$SERVICE"
    114.         echo "Minecraft successfully updated."
    115.       fi
    116.     else
    117.       echo "Minecraft update could not be downloaded."
    118.     fi
    119.   fi
    120. }
    121.  
    122. mc_backup() {
    123.   echo "Backing up minecraft world..."
    124.   if [ -d $BACKUPPATH/${WORLD}_`date "+%Y.%m.%d_%H.%M"` ]
    125.   then
    126.     for i in 1 2 3 4 5 6
    127.     do
    128.       if [ -d $BACKUPPATH/${WORLD}_`date "+%Y.%m.%d_%H.%M"`-$i ]
    129.       then
    130.         continue
    131.       else
    132.         as_user "cd $MCPATH && cp -r $WORLD $BACKUPPATH/${WORLD}_`date "+%Y.%m.%d_%H.%M"`-$i"
    133.         break
    134.       fi
    135.     done
    136.   else
    137.     as_user "cd $MCPATH && cp -r $WORLD $BACKUPPATH/${WORLD}_`date "+%Y.%m.%d_%H.%M"`"
    138.     echo "Backed up world"
    139.   fi
    140.   echo "Backing up $SERVICE"
    141.   if [ -f "$BACKUPPATH/craftbukkit_`date "+%Y.%m.%d_%H.%M"`.jar" ]
    142.   then
    143.     for i in 1 2 3 4 5 6
    144.     do
    145.       if [ -f "$BACKUPPATH/craftbukkit_`date "+%Y.%m.%d_%H.%M"`-$i.jar" ]
    146.       then
    147.         continue
    148.       else
    149.         as_user "cd $MCPATH && cp $SERVICE \"$BACKUPPATH/craftbukkit_`date "+%Y.%m.%d_%H.%M"`-$i.jar\""
    150.         break
    151.       fi
    152.     done
    153.   else
    154.     as_user "cd $MCPATH && cp $SERVICE \"$BACKUPPATH/craftbukkit_`date "+%Y.%m.%d_%H.%M"`.jar\""
    155.   fi
    156.   echo "Backup complete"
    157. }
    158.  
    159. mc_command() {
    160.   command="$1";
    161.   if pgrep -u $USERNAME -f $SERVICE > /dev/null
    162.   then
    163.     pre_log_len=`wc -l "$MCPATH/server.log" | awk '{print $1}'`
    164.     echo "$SERVICE is running... executing command"
    165.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"$command\"\015'"
    166.     sleep .1 # assumes that the command will run and print to the log file in less than .1 seconds
    167.     # print output
    168.     tail -n $[`wc -l "$MCPATH/server.log" | awk '{print $1}'`-$pre_log_len] "$MCPATH/server.log"
    169.   fi
    170. }
    171.  
    172. #Start-Stop here
    173. case "$1" in
    174.   start)
    175.     mc_start
    176.     ;;
    177.   stop)
    178.     mc_stop
    179.     ;;
    180.   restart)
    181.     mc_stop
    182.     mc_start
    183.     ;;
    184.   update)
    185.     mc_stop
    186.     mc_backup
    187.     mc_update
    188.     mc_start
    189.     ;;
    190.   backup)
    191.     mc_saveoff
    192.     mc_backup
    193.     mc_saveon
    194.     ;;
    195.   status)
    196.     if pgrep -u $USERNAME -f $SERVICE > /dev/null
    197.     then
    198.       echo "$SERVICE is running."
    199.     else
    200.       echo "$SERVICE is not running."
    201.     fi
    202.     ;;
    203.   command)
    204.     if [ $# -gt 1 ]; then
    205.       shift
    206.       mc_command "$*"
    207.     else
    208.       echo "Must specify server command (try 'help'?)"
    209.     fi
    210.     ;;
    211.  
    212.   *)
    213.   echo "Usage: runmc {start|stop|update|backup|status|restart|command \"server command\"}"
    214.   exit 1
    215.   ;;
    216. esac
    217.  
    218. exit 0
     
  4. Offline

    TnT Retired Staff

    My BukkitDev Profile
    My Plugins (2)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I have this: http://dev.bukkit.org/server-mods/ascii-bukkit-menu/
     
  5. Offline

    palisade

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I decided to look into the ascii-bukkit-menu and other than ramdisk my script and theirs does almost the same thing except that you can see when users join/leave. However, if you had 200 users it wouldn't work anyways. Also, you can't detach the screen in interactive mode or you lose the vertical layout when you reattach. Worth noting, they check if the process ID is still running before they move on, instead of just sleeping an arbitrary amount of time which is an improvement over what I was doing which became a problem as more plugins were being added to the server. The only real advantage the script I provided had was the ability to backup the world and bukkit jar.

    I went ahead and modified ascii-bukkit-menu some and added the following features:

    --status - this will print out running or stopped to let you know the state of your server
    --restart - allows you to restart your server
    --backup - performs a backup of your world and bukkit jar

    And, I created a recover.sh and placed it in Ascii-Bukkit-Menu like so (make this chmod +x):

    Code (Text):
    1. #!/bin/bash
    2. /home/USERNAME/Ascii-Bukkit-Menu/abm.sh --status>/dev/null
    3.  
    4. if [[ 1 == $? ]]; then
    5.         /home/USERNAME /Ascii-Bukkit-Menu/abm.sh --start
    6. fi
    This recovers from a crash and brings the server back up if you call it in a cron job. You can set up a cron job by typing: crontab -e

    And then paste the following to give it a 5 minute interval check (this is lightweight since it only does a --status, which will only check the pid if it is still running):

    Code (Text):
    1. */5 * * * * /home/USERNAME/Ascii-Bukkit-Menu/recover.sh
    I'll go ahead and zip this up and make it available for anyone who wants to try out my changes. Go ahead and grab the latest abm and install it and set it up, then you can just drop functions.sh and menu.sh in the scripts dir and overwite your abm.sh with mine, and drop recover.sh next to abm.sh. Just make sure to edit each and every one of these scripts and change /home/palisade to your own path.

    Here are my changes... I fixed a bug in the previous abm.sh, this one should be fine now.

    http://rm-f.net/~palisade/abm-new-v1-1.tgz

    There is a bug in updating that was in the original abm, I haven't had a chance to fix it yet. Been scurrying to get my bukkit server compliant with 1.2.

    Enjoy!
     
  6. Offline

    palisade

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I decided to paste this as a new comment just in case someone still wants to use the previous script that simply copies the folder to the backup directory. That is faster than compressing, and since your world is in readonly mode while this is happening users might be unhappy if it takes too long. So, there's a disadvantage to doing it this way, as long as you're aware of that here it is.

    Note again that you should change CPU_COUNT and anywhere it says USERNAME, and set your BACKUPPATH and WORLD* variables to point to the correct paths.

    This version compresses the world folders with a progress bar, and handles nether and the end as well. It requires you have pv (pipeviewer) installed which you can get from sourceforge or apt-get, etc.

    Code (Text):
    1. #!/bin/bash
    2. # /home/USERNAME/mc
    3.  
    4. ### BEGIN INIT INFO
    5. # Provides:  minecraft
    6. # Required-Start: $local_fs $remote_fs
    7. # Required-Stop:  $local_fs $remote_fs
    8. # Should-Start:  $network
    9. # Should-Stop:    $network
    10. # Default-Start:  2 3 4 5
    11. # Default-Stop:  0 1 6
    12. # Short-Description:    mc server
    13. # Description:    starts mc server
    14. ### END INIT INFO
    15.  
    16. #Settings
    17. SERVICE='craftbukkit.jar'
    18. OPTIONS='nogui'
    19. USERNAME='USERNAME'
    20. WORLD='world'
    21. WORLDNETHER='world_nether'
    22. WORLDEND='world_the_end'
    23. MCPATH='/home/USERNAME/mc'
    24. BACKUPPATH='/home/USERNAME/mcbackup'
    25. CPU_COUNT=4
    26. INVOCATION="java -Xmx2048M -Xms2048M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=$CPU_COUNT -XX:+AggressiveOpts -jar $SERVICE $OPTIONS"
    27.  
    28. ME=`whoami`
    29. as_user() {
    30.   if [ $ME == $USERNAME ] ; then
    31.     bash -c "$1"
    32.   else
    33.     su - $USERNAME -c "$1"
    34.   fi
    35. }
    36.  
    37. mc_start() {
    38.   if  pgrep -u $USERNAME -f $SERVICE > /dev/null
    39.   then
    40.     echo "$SERVICE is already running!"
    41.   else
    42.     rm -f "$MCPATH/server.log"
    43.     echo "Starting $SERVICE..."
    44.     cd $MCPATH
    45.     as_user "cd $MCPATH && screen -dmS mcserver $INVOCATION"
    46.     sleep 7
    47.     if pgrep -u $USERNAME -f $SERVICE > /dev/null
    48.     then
    49.       echo "$SERVICE is now running."
    50.     else
    51.       echo "Error! Could not start $SERVICE!"
    52.     fi
    53.   fi
    54. }
    55.  
    56. mc_saveoff() {
    57.   if pgrep -u $USERNAME -f $SERVICE > /dev/null
    58.   then
    59.     echo "$SERVICE is running... suspending saves"
    60.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"say SERVER BACKUP STARTING. Server going readonly...\"\015'"
    61.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"save-off\"\015'"
    62.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"save-all\"\015'"
    63.     sync
    64.     sleep 10
    65.   else
    66.     echo "$SERVICE is not running. Not suspending saves."
    67.   fi
    68. }
    69.  
    70. mc_saveon() {
    71.   if pgrep -u $USERNAME -f $SERVICE > /dev/null
    72.   then
    73.     echo "$SERVICE is running... re-enabling saves"
    74.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"save-on\"\015'"
    75.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"say SERVER BACKUP ENDED. Server going read-write...\"\015'"
    76.   else
    77.     echo "$SERVICE is not running. Not resuming saves."
    78.   fi
    79. }
    80.  
    81. mc_stop() {
    82.   if pgrep -u $USERNAME -f $SERVICE > /dev/null
    83.   then
    84.     echo "Stopping $SERVICE"
    85.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"say SERVER SHUTTING DOWN IN 10 SECONDS. Saving map...\"\015'"
    86.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"save-all\"\015'"
    87.     sleep 10
    88.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"stop\"\015'"
    89.     sleep 20
    90.   else
    91.     echo "$SERVICE was not running."
    92.   fi
    93.   if pgrep -u $USERNAME -f $SERVICE > /dev/null
    94.   then
    95.     echo "Error! $SERVICE could not be stopped."
    96.   else
    97.     echo "$SERVICE is stopped."
    98.   fi
    99. }
    100.  
    101. mc_update() {
    102.   if pgrep -u $USERNAME -f $SERVICE > /dev/null
    103.   then
    104.     echo "$SERVICE is running! Will not start update."
    105.   else
    106. #    MC_SERVER_URL=http://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar?v=`date | sed "s/[^a-zA-Z0-9]/_/g"`
    107.     MC_SERVER_URL=http://dl.bukkit.org/latest-rb/craftbukkit.jar
    108.     as_user "cd $MCPATH && wget -q -O $MCPATH/craftbukkit.jar.update $MC_SERVER_URL"
    109.     if [ -f $MCPATH/craftbukkit.jar.update ]
    110.     then
    111.       if `diff $MCPATH/$SERVICE $MCPATH/craftbukkit.jar.update >/dev/null`
    112.       then
    113.         echo "You are already running the latest version of $SERVICE."
    114.       else
    115.         as_user "mv $MCPATH/craftbukkit.jar.update $MCPATH/$SERVICE"
    116.         echo "Minecraft successfully updated."
    117.       fi
    118.     else
    119.       echo "Minecraft update could not be downloaded."
    120.     fi
    121.   fi
    122. }
    123.  
    124. mc_backup_world() {
    125.   echo "Backing up world... $1"
    126.   if [ -d $BACKUPPATH/${1}_`date "+%Y.%m.%d_%H.%M"` ]
    127.   then
    128.     for i in 1 2 3 4 5 6
    129.     do
    130.       if [ -d $BACKUPPATH/${1}_`date "+%Y.%m.%d_%H.%M"`-$i ]
    131.       then
    132.         continue
    133.       else
    134.         as_user "cd $MCPATH && tar -cf - $1 | pv | gzip - > $BACKUPPATH/${1}_`date "+%Y.%m.%d_%H.%M"`-$i.tgz"
    135. #        as_user "cd $MCPATH && cp -r $1 $BACKUPPATH/${1}_`date "+%Y.%m.%d_%H.%M"`-$i"
    136.         break
    137.       fi
    138.     done
    139.   else
    140.     as_user "cd $MCPATH && tar -cf - $1 | pv | gzip - > $BACKUPPATH/${1}_`date "+%Y.%m.%d_%H.%M"`-$i.tgz"
    141. #    as_user "cd $MCPATH && cp -r $1 $BACKUPPATH/${1}_`date "+%Y.%m.%d_%H.%M"`"
    142.     echo "Backed up world"
    143.   fi
    144. }
    145.  
    146. mc_backup_service() {
    147.   echo "Backing up $SERVICE"
    148.   if [ -f "$BACKUPPATH/craftbukkit_`date "+%Y.%m.%d_%H.%M"`.jar" ]
    149.   then
    150.     for i in 1 2 3 4 5 6
    151.     do
    152.       if [ -f "$BACKUPPATH/craftbukkit_`date "+%Y.%m.%d_%H.%M"`-$i.jar" ]
    153.       then
    154.         continue
    155.       else
    156.         as_user "cd $MCPATH && cp $SERVICE \"$BACKUPPATH/craftbukkit_`date "+%Y.%m.%d_%H.%M"`-$i.jar\""
    157.         break
    158.       fi
    159.     done
    160.   else
    161.     as_user "cd $MCPATH && cp $SERVICE \"$BACKUPPATH/craftbukkit_`date "+%Y.%m.%d_%H.%M"`.jar\""
    162.   fi
    163.   echo "Backup complete"
    164. }
    165.  
    166. mc_command() {
    167.   command="$1";
    168.   if pgrep -u $USERNAME -f $SERVICE > /dev/null
    169.   then
    170.     pre_log_len=`wc -l "$MCPATH/server.log" | awk '{print $1}'`
    171.     echo "$SERVICE is running... executing command"
    172.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"$command\"\015'"
    173.     sleep .1 # assumes that the command will run and print to the log file in less than .1 seconds
    174.     # print output
    175.     tail -n $[`wc -l "$MCPATH/server.log" | awk '{print $1}'`-$pre_log_len] "$MCPATH/server.log"
    176.   fi
    177. }
    178.  
    179. #Start-Stop here
    180. case "$1" in
    181.   start)
    182.     mc_start
    183.     ;;
    184.   stop)
    185.     mc_stop
    186.     ;;
    187.   restart)
    188.     as_user "screen -p 0 -S mcserver -X eval 'stuff \"say SERVER REBOOTING IN 10 SECONDS, WILL BE BACK IN 30 to 40 SECONDS...\"\015'"
    189.     mc_stop
    190.     sleep 5
    191.     mc_start
    192.     ;;
    193.   update)
    194.     mc_stop
    195.     mc_backup_world $WORLD
    196.     mc_backup_world $WORLDNETHER
    197.     mc_backup_world $WORLDEND
    198.     mc_backup_service
    199.     mc_update
    200.     mc_start
    201.     ;;
    202.   backup)
    203.     mc_saveoff
    204.     mc_backup_world $WORLD
    205.     mc_backup_world $WORLDNETHER
    206.     mc_backup_world $WORLDEND
    207.     mc_backup_service
    208.     mc_saveon
    209.     ;;
    210.   status)
    211.     if pgrep -u $USERNAME -f $SERVICE > /dev/null
    212.     then
    213.       echo "$SERVICE is running."
    214.     else
    215.       echo "$SERVICE is not running."
    216.     fi
    217.     ;;
    218.   command)
    219.     if [ $# -gt 1 ]; then
    220.       shift
    221.       mc_command "$*"
    222.     else
    223.       echo "Must specify server command (try 'help'?)"
    224.     fi
    225.     ;;
    226.  
    227.   *)
    228.   echo "Usage: mc {start|stop|update|backup|status|restart|command \"server command\"}"
    229.   exit 1
    230.   ;;
    231. esac
    232.  
    233. exit 0

    NOTE: You may want to replace the backup stuff I posted above with something easier like:

    Code (Text):
    1. backupWorld() {
    2.   echo "Backing up $1"
    3.   as_user "tar -cf - $1 | pv | gzip - > $BACKUP/$1.tgz"
    4. }
    5.  
    6. backupService() {
    7.   echo "Backing up craftbukkit.jar"
    8.   as_user "cp $bukkitdir/$cbfile $BACKUP/$cbfile"
    9.   echo "Backup complete"
    10. }
    11.  
    12. performBackup() {
    13.         PATHDATE=`date "+%Y.%m.%d_%H.%M"`
    14.         BACKUP="$BACKUPPATH/$PATHDATE"
    15.         mkdir $BACKUP
    16.         backupWorld $WORLD
    17.         backupWorld $WORLDNETHER
    18.         backupWorld $WORLDEND
    19.         backupService
    20. }
    You'll see a result when you run it like:

    Code (Text):
    1. Server Already Running..
    2. SERVER BACKUP STARTING.. Server going readonly...
    3. Backing up world
    4. 241MB 0:00:18 [12.9MB/s] [                                <=>                                                      ]
    5. Backing up world_nether
    6. 18.3MB 0:00:01 [  13MB/s] [  <=>                                                                                    ]
    7. Backing up world_the_end
    8. 7.2MB 0:00:00 [  33MB/s] [ <=>                                                                                      ]
    9. Backing up craftbukkit.jar
    10. Backup complete
    11. SERVER BACKUP ENDED. Server going read-write...
    12. Sync complete. Server now read-write.
    This second example will create a directory that is simply a date inside your backup path. So, if your path is /home/user/mcbackup then it'll look like:

    Code (Text):
    1. mcbackup/2012.03.03_20.17:
    2. total 183000
    3. -rw-r--r-- 1 palisade users  11039568 Mar  3 20:17 craftbukkit.jar
    4. -rw-r--r-- 1 palisade users  10929243 Mar  3 20:17 world_nether.tgz
    5. -rw-r--r-- 1 palisade users 164793721 Mar  3 20:17 world.tgz
    6. -rw-r--r-- 1 palisade users    414340 Mar  3 20:17 world_the_end.tgz
     
  7. Offline

    Solaridors

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I Dont understandt part 1 i dowload it but dont know how to instal it
     
  8. Offline

    Xptical

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  9. Offline

    TheEstMacRam

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    s
    sorry dude, but It does not, I can prove it, because I use OpenJDK 7 instead of oracle or sun java, and I can run minecraft with no problem at all, also my bukkit server works perfectly.
     
  10. Offline

    arweth

    My BukkitDev Profile
    My Plugins (1)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Mate before you reply to a post especially regarding something about compatibility check how old the post is. Unless you are running the version that was current on the 16th of Jan 2011 then you cant say it did back then. It may work now with the latest versions but back then it obviously didn't.
     
  11. Offline

    blackice504

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Hi TNT i also use Ubuntu 64 bit Server working well, but read your tutorial anyway because you never know there maybe new tricks, here is my one for Sun Java 64bit.
    i hope this helps your tut,

    sudo apt-get install python-software-properties
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get dist-upgrade
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java7-installer
    java -version

    this was done on ubuntu64 bit linux 12.4

    This is a simpler way to install java.
    pm me if you have any problems.

    Great Tutorial.

    Java just changed there agreements, so if the first script not work this will

    sudo sh -c "echo 'deb http://www.duinsoft.nl/pkg debs all' >> /etc/apt/sources.list"
    sudo apt-get update
    sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 5CB36B26
    sudo apt-get update
    sudo apt-get install update-sun-jre
    java -version

    people if you use it more then once make a javaupdate.sh ;)
     
    Vern8k likes this.
  12. Offline

    waco001

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Will this work for the normal desktop version too? Thx
     
  13. Offline

    TnT Retired Staff

    My BukkitDev Profile
    My Plugins (2)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Yes, they are very similar in nature.
     
  14. Offline

    Vern8k

    My BukkitDev Profile
    My Plugins (0)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  15. Offline

    Zeppelin

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  16. Offline

    West_Dover

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    TnT I need your help....
    I have already existing Bukkit server that I downloaded onto the OS. I created the file "start.sh" but i dont know how or where to download Java 64... Also i cant figure out how to SSH from my mac.

    Please help,
    West
     
  17. Offline

    TnT Retired Staff

    My BukkitDev Profile
    My Plugins (2)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  18. Offline

    computerman_

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    i'm getting two errors that are repeating very fast they'er,
    Code (Text):
    1.  
    2. at net.minecraft.server.v_16_R2.PropertyManager.a(PropertyManger.java:66)
    3. at net.minecraft.server.v_16_R2.PropertyManager.savePropertiesFile(PropertyManger.java:82)
    4.  
    and i'm also runing X32 bit not X64
     
  19. Offline

    TnT Retired Staff

    My BukkitDev Profile
    My Plugins (2)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    computerman_
    Pastebin your full server.log - that doesn't look to be an error with CraftBukkit.
     
  20. Offline

    computerman_

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    TnT
    it was the start up code its fixed do you, do you still want me to paste it?
     
  21. Offline

    TnT Retired Staff

    My BukkitDev Profile
    My Plugins (2)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I am interested in seeing details on the problem and what you did to fix it. :)
     
  22. Offline

    computerman_

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    TnT
    i just used a different java code to start it that is in the coments that you might of posted, or i used the code on wiki
    :| i just noticed it didn't create the server.log with the errors sorry, also the java installation Din't work for me i used a command i found on a different forums for ubuntu "sudo apt-get install open-7-jdk icedtea-7-plugin" and last of all Thanks for the tutorial
     
  23. Offline

    TnT Retired Staff

    My BukkitDev Profile
    My Plugins (2)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    computerman_
    Ahh. My tutorial installs Oracle Java, not OpenJDK. Glad you found the rest of the tutorial useful. :)
     
    zaphodikus likes this.
  24. Offline

    LandonTheGeek

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I love how this was made back in 2011 but still gets great feedback. :) And it should, because this is a great tutorial. Very detailed and well done! :D TnT
     
  25. Offline

    Iroh Retired Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Just set up my first vps for my new server this was a god send :)

    Just a note the auto-extracting of the jre file didn't work for me and I needed to use tar
    Code (Text):
    1. tar -xvf /tmp/jre-7u67-linux-x64
    2.  
    Not sure if this is a common problem or not but it might be worth including a note in the tutorial.
     
  26. Offline

    ZodiacTheories

    My BukkitDev Profile
    My Plugins (3)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  27. Offline

    LHammonds

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    If a post adds information not previously mentioned, its OK in my book, even if extremely necrotic in nature (however, I have seen threads locked in similar situations before. hehehe)
     
  28. Offline

    Tabardia

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I got stuck at step 3, any updated info on how to do it?
    Guide seems nice though, thank you!
     
  29. Offline

    TnT Retired Staff

    My BukkitDev Profile
    My Plugins (2)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Tabardia likes this.
  30. Offline

    Tabardia

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I figured it out and your guide was great help! just bypassed that step and downloaded the jar I wanted from bukkit.
     

Share This Page