Trying New Features (Python)

From MineOS Wiki
Jump to navigation Jump to search

This wiki page lists experimental features. This means they have not yet been rigorously tested and have significant implications about script performance/stability. This does not mean the scripts are suddenly dangerous to your worlds and servers, but substantial changes to the code base can always have unforeseen bugs, even if minor; I have tried to list the scope of the changes and the possible affected areas below.

phar (pocketmine server)

STATUS: Pending phar branch

This branch opens up a new server type, php_phar, to accommodate the PocketMine server for Minecraft Pocket Edition. This branch is not even close to production quality, but it doesn't seem dangerous at all.

The worst that could happen: One or more pages may not render the dynamic data in the web-ui.

Developer reassurances: Each page that renders dynamic data has to be individually modified in the Python source, but I feel confident I have 100% of them.

When to feel comfy it is working OK: After a while, when I figure out all the nuances and special configs behind PocketMine.

no_ajax_caching

STATUS: Merged in with PR #98

This branch explicitly disables ajax caching by decorating each call with an expires header, cache-control, etc.

The worst that could happen: One or more pages may not render the dynamic data in the web-ui.

Developer reassurances: I tried it in FF, IE11, and Chrome. No issues arose.

When to feel comfy it is working OK: If each page shows the data you're expecting, all is well.

stop_and_backup

STATUS: Merged in with PR #79

This branch adds the "stop and backup" option to the web-ui (and also to CLI) which synchronously (as opposed to normal async) stops a server and then initiates a backup and waits until the backup completes before returning control.

The worst that could happen: If attempting to stop a server with the new "Stop and Backup", but the server itself hangs (and would have, anyway), the web-ui will block (be non-responsive) indefinitely. Killing the minecraft process manually (outside the webui) will fix the issue and restore web-ui operation.

Developer reassurances: You can just not use the 'stop and backup' button, and everything else will stay the same.

When to feel comfy it is working OK: If your servers always close gracefully when told to (using the 'stop' buttons or typing it into the console), this will always work.

For ramdisk configurations

Update: this tweak is still relevant for users who wish to use ramdisks (not recommended to do so!). This is in addition to using a current web-ui commit.

This tweak is designed for admins utilizing ramdisks, where the backup is an absolute necessity before restarts. In your /etc/init.d/minecraft initscript, change line #34:

python $SCRIPTPATH/$SERVER -d $DATAPATH stop

to

python $SCRIPTPATH/$SERVER -d $DATAPATH stop_and_backup

restart_interval

STATUS: Implemented into master branch with git pull 35

Auto restarting the server can now be done at any interval, the same as archive/backups. To enable this feature, switch to the commitdelay git branch and add the following attribute to your server.config: [crontabs] restart_interval. A value of 0 will mean daily reboots. To make it more manageable, refreshing the server.config pane will automatically transform the textbox into a descriptive dropdown.

The worst that could happen: crontab-related functions error out and fail

Developer reassurances: manual backup/archiving is absolutely 100% intact and working.

When to feel comfy it is working OK: During testing of this branch, it is recommended to check the success of your next few scheduled backup/archive. If you do hourly backups and the upcoming hourly backup succeeds, everything probably will work out fine from then on. To be on the safe side, if you create or remove a server, I'd suggest checking the success of the upcoming backup again, as well.

changing git branches

Depending on the feature you are trying to add, the below commitdelay may be a different branch. Each above section has highlighted what branch you will switch to.

<syntaxhighlight lang="bash"> root@core ~# cd /usr/games/minecraft root@core games/minecraft# git fetch remote: Counting objects: 14, done. remote: Compressing objects: 100% (11/11), done. remote: Total 14 (delta 4), reused 13 (delta 3) Unpacking objects: 100% (14/14), done. From https://github.com/hexparrot/mineos

* [new branch]      commitdelay -> origin/commitdelay

root@core games/minecraft# git checkout commitdelay Switched to branch 'commitdelay' </syntaxhighlight>

what to do if something feels wrong

Preferably, if you can, please send me the traceback/errors you have in /var/log/mineos.log or any other information you find pertinent. If you're in extra panic mode, the way to restore the stable scripts is similar to resetting the scripts; notice the git checkout master.