[Support] binhex - MinecraftServer


Recommended Posts

  • 3 weeks later...
On 12/26/2019 at 4:44 PM, unraidnh said:

How do I start a backup? I see the option for defining the MAX_BACKUPS option, but I'm not seeing any Backup beeing made.
But nice work so far. Works like a charm, thank you very much.

docker exec -u nobody -t <name of container> /usr/bin/minecraftd backup

Or if in the shell of the docker container

[root@b6d917bc09e6 /]# /usr/bin/minecraftd 
This script was design to easily control any minecraft server. Quite every parameter for a given
minecraft server derivative can be altered by editing the variables in the configuration file.

Usage: minecraftd {start|stop|status|backup|restore|command <command>|console}
    start                Start the minecraft server
    stop                 Stop the minecraft server
    restart              Restart the minecraft server
    status               Print some status information
    backup               Backup the world data
    restore [filename]   Restore the world data from a backup
    command <command>    Run the given comman at the minecraft server console
    console              Enter the server console through a screen session

Link to comment
15 hours ago, bpapilot said:

docker exec -u nobody -t <name of container> /usr/bin/minecraftd backup

Or if in the shell of the docker container

[root@b6d917bc09e6 /]# /usr/bin/minecraftd 
This script was design to easily control any minecraft server. Quite every parameter for a given
minecraft server derivative can be altered by editing the variables in the configuration file.

Usage: minecraftd {start|stop|status|backup|restore|command <command>|console}
    start                Start the minecraft server
    stop                 Stop the minecraft server
    restart              Restart the minecraft server
    status               Print some status information
    backup               Backup the world data
    restore [filename]   Restore the world data from a backup
    command <command>    Run the given comman at the minecraft server console
    console              Enter the server console through a screen session

@unraidnh or for a more higher level backup, take a look at the 'CA Appdata Backup Restore v2' plugin, available on CA. 

Edited by binhex
Link to comment
  • 4 weeks later...

Thanks all for the info above.  I was able to get container/ server up and running and allow myself and my neighbor to connect and play on the server.  However,  I could not change any of the server settings such as coordinates.  This is my first time working with minecraft.  Is there an easy way to change the server settings such as coordinates with a web GUI or other program.  I'm still getting used to docker and all the command structure.  does the container need to be running to edit the minecraft server properties? 

Link to comment
13 hours ago, orangeace said:

Is there an easy way to change the server settings such as coordinates with a web GUI or other program

im not too sure what you mean by coordinates, but some things can be changed in the server.properties file located in /config/minecraft/ folder.then restart the container to pick up the change, for other changes you can use theminecraft console:-

https://forums.unraid.net/topic/84880-support-binhex-minecraftserver/?do=findComment&comment=811097

 

Link to comment
28 minutes ago, opiekeith said:

Is this thread used for binhex/arch-minecraftbedrockserver also ?  I am gettting stuck on building world when going into and out the nether.  I did some diging and they say to backup and restore your world, but not sure how to do that in this env.

 

TIA

nope seperate support thread for bedrock, this is for the java version only, post it here:- 

 

Link to comment
  • 2 weeks later...
On 3/18/2020 at 2:03 PM, binhex said:

what is the command you are issuing in order to get to the minecraft console?

Hello, not the same person, but the same problem. I am using 

docker exec -u nobody -t binhex-minecraftserver /usr/bin/minecraftd console

on Unraid 6.8.2

Link to comment
Hello, not the same person, but the same problem. I am using 

docker exec -u nobody -t binhex-minecraftserver /usr/bin/minecraftd console

on Unraid 6.8.2

 

Your are missing the interactive flag, so change -t to -it

 

Sent from my CLT-L09 using Tapatalk

 

 

 

Link to comment
11 hours ago, binhex said:

Your are missing the interactive flag, so change -t to -it

 

Sent from my CLT-L09 using Tapatalk

 

 

 

Thank you, this worked for me. I found the command on I believe your FAQ page, so maybe change that over to be -it as well

Link to comment
On 11/6/2019 at 8:18 AM, binhex said:

a good question, added to readme:-

 

If you want to connect to the minecraft server console then issue the following command, use CTRL+a and then press 'd' to disconnect from the session, leaving it running.

 

This must have been where I got the command from then

Edited by jonathanm
Removed quoted info
Link to comment

Hello I just installed this container, however when I restart it the world gets reset. Do I need to map a specific data path?

It currently is saving the world to the appdata folder, which seems like its right, but I might be missing something.

 

Thanks!

 

EDIT:

Figured out that if you manually run /save-all it will immediately save all changes, so that when you restart these changes won't be lost. Im guessing that the command runs on an interval since /save-on returns "already on". But this means that unless you manually /save-all before a restart you will probably lose a couple of minutes of data.

 

It would be nice if triggering a container shutdown/restart could also trigger the server /save-all command before shutting down.

Edited by oko2708
Link to comment
5 hours ago, nuhll said:

wtf, doesnt it auto save on restart? I didnt notice any loss, but wtf? Using it for a month or so now... ?!

saving on shutdown is pretty much impossible in docker, as there is no nice pre shutdown procedure in docker, its simple a matter of sigint to the child processes, its not like a full fat linux distro with systemd.

 

im assuming it doesnt auto save on ANY change because this would cripple performance, thus there is a trade off between loss of data and performance. tbh unless you play minecraft and then instantly shut the container down straight after (why would you do this?!) then i suspect you wont see the issue, as the server will probably (i dont know this) auto save on an interval (dont know the internval).

 

edit - yep is does autosave, every 5 mins:- Minecraft servers have the ability to automatically save world data periodically. By default, Minecraft servers do this every 6000 ticks (5 minutes) and is ideal so that changes to your world are retained in case a restart or server crash occurs.

Edited by binhex
Link to comment
5 hours ago, binhex said:

saving on shutdown is pretty much impossible in docker, as there is no nice pre shutdown procedure in docker, its simple a matter of sigint to the child processes, its not like a full fat linux distro with systemd.

 

im assuming it doesnt auto save on ANY change because this would cripple performance, thus there is a trade off between loss of data and performance. tbh unless you play minecraft and then instantly shut the container down straight after (why would you do this?!) then i suspect you wont see the issue, as the server will probably (i dont know this) auto save on an interval (dont know the internval).

 

edit - yep is does autosave, every 5 mins:- Minecraft servers have the ability to automatically save world data periodically. By default, Minecraft servers do this every 6000 ticks (5 minutes) and is ideal so that changes to your world are retained in case a restart or server crash occurs.

Sorry, b ut i cant believe it. There are many dockers which do a correct shutdown...? What is the problem? Isnt there a script you can force to run on exit? I mean, on a hard STOP you cant do anything, sure, but if its normal stopped/restarted?

 

Quote

 


The docker stop command attempts to stop a running container first by sending a SIGTERM signal to the root process (PID 1) in the container. If the process hasn't exited within the timeout period a SIGKILL signal will be sent.

In practice, that means that you have to define an ENTRYPOINT script, which will intercept (trap) the SIGTERM signal and execute any shutdown logic as appropriate.

A sample entrypoint script can look something like this:

#!/bin/bash #Define cleanup procedure cleanup() { echo "Container stopped, performing cleanup..." } #Trap SIGTERM trap 'cleanup' SIGTERM #Execute a command "${@}" & #Wait wait $!
 

 

https://stackoverflow.com/questions/41451159/how-to-execute-a-script-when-i-terminate-a-docker-container

 

So just send a

 

/stop (does save everything)

 

upon stop...?

 

This miencraft container does it right (itzg/minecraft-server)

Quote

 

[m[32m[15:20:18] [main/INFO] [ne.mi.fm.lo.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust
[m[32m[15:20:18] [main/INFO] [cp.mo.mo.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmlserver' with arguments [--gameDir, .]
2020/03/26 15:20:20 Stopping with rcon-cli
2020/03/26 15:20:20 ERROR Failed to stop using rcon-cli exit status 1
2020/03/26 15:20:20 Sending 'stop' to Minecraft server...
2020/03/26 15:20:20 Waiting for completion...

 

(it sends a stop to the minecraft server, which also saves ofc)

Edited by nuhll
Link to comment
31 minutes ago, nuhll said:

Sorry, b ut i cant believe it. There are many dockers which do a correct shutdown...?

i didnt say the container didnt shutdown correctly, it does shutdown in a clean fashion (unless sigterm fails in which case its a sigkill) it just doesnt perform any pre shutdown commands (which nearly all apps do NOT require, as most apps handle this themselves).

 

whilst the link to the script you posted is definitely interesting, it would require additional work to make it production ready, requiring retry counts, timeouts, backoffs and other functions to capture certain conditions which occur under load, so it wont be the simplest thing to code up, but maybe possible with some additional work.

 

i will have a think about the best way of implementing this, but it probably wont get done any time soon im afraid.

 

 

 

 

Link to comment
On 3/26/2020 at 4:40 PM, binhex said:

i didnt say the container didnt shutdown correctly, it does shutdown in a clean fashion (unless sigterm fails in which case its a sigkill) it just doesnt perform any pre shutdown commands (which nearly all apps do NOT require, as most apps handle this themselves).

 

whilst the link to the script you posted is definitely interesting, it would require additional work to make it production ready, requiring retry counts, timeouts, backoffs and other functions to capture certain conditions which occur under load, so it wont be the simplest thing to code up, but maybe possible with some additional work.

 

i will have a think about the best way of implementing this, but it probably wont get done any time soon im afraid.

 

 

 

 

Im just guessing, but if you send a "stop" (sigterm) to minecraft, i guess its shutting down correctly (and therefore saving)...?!

 

edit:

ya

https://gaming.stackexchange.com/questions/282498/is-sending-sigterm-to-a-minecraft-server-equal-to-using-the-stop-command

 

btw i found this:

https://gist.github.com/sbstp/9b4e3bfa36547da782cb428d61a062eb

Edited by nuhll
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.