From 368645be705bcd33123faebce3ae78a7d49269d0 Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Mon, 22 May 2017 11:50:56 -0400 Subject: [PATCH] update overviewer setup to not use cron --- crontab | 4 -- get-texture-pack.sh | 3 - mc-init-config | 130 ----------------------------------- nginx-minecraft-overviewer | 13 ---- overviewer/Dockerfile | 8 +-- overviewer/run-overviewer.sh | 12 ++++ provision.sh | 8 +-- 7 files changed, 15 insertions(+), 163 deletions(-) delete mode 100644 crontab delete mode 100755 get-texture-pack.sh delete mode 100644 mc-init-config delete mode 100644 nginx-minecraft-overviewer create mode 100755 overviewer/run-overviewer.sh diff --git a/crontab b/crontab deleted file mode 100644 index 2bf8d07..0000000 --- a/crontab +++ /dev/null @@ -1,4 +0,0 @@ -02 05 * * * /etc/init.d/minecraft backup -55 04 * * * /etc/init.d/minecraft log-roll -*/30 * * * * /etc/init.d/minecraft to-disk -31 05 * * * /etc/init.d/minecraft overviewer diff --git a/get-texture-pack.sh b/get-texture-pack.sh deleted file mode 100755 index 62e93ac..0000000 --- a/get-texture-pack.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -VERSION=${1-1.8} -wget -q https://s3.amazonaws.com/Minecraft.Download/versions/${VERSION}/${VERSION}.jar -P /home/notch/mc-overviewer/ diff --git a/mc-init-config b/mc-init-config deleted file mode 100644 index 1cd1158..0000000 --- a/mc-init-config +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/bash -# -# Settings file for minecraft-init -# ================================ -# -# Make a copy of this file named config -# and edit the variables to your needs. -# - -# Name of vanilla server jar (no need to change if you're running craftbukkit and vice versa) -MC_JAR="minecraft_server.jar" - -# Name of craftbukkit jar -CB_JAR="craftbukkit.jar" - -# Define the release of CraftBukkit to use (stable or unstable) -CB_RELEASE="stable" - -# Name of server.jar to use (either $MC_JAR or $CB_JAR) -SERVICE=$MC_JAR - -# Name to use for the screen instance -SCREEN="server_screen" - -# User that should run the server -USERNAME="notch" - -# Path to minecraft server directory -MCPATH="/home/${USERNAME}/minecraft" - -# Path to server log file ($MCPATH/server.log on older versions) -SERVERLOG="${MCPATH}/logs/latest.log" - -# Where the worlds are located on the disk. Can not be the same as MCPATH. -# You need to move your worlds to this directory manually, the script -# will then handle the nessessay symlinks. -WORLDSTORAGE="${MCPATH}/worlds" - -# Number of CPUs/cores to use -CPU_COUNT=2 - -# Initial memory usage -INITMEM="2048M" - -# Maximum amount of memory to use -# Remember: give the ramdisk enough space, subtract from the total amount -# of RAM available the size of your map and the RAM-consumption of your base system. -MAXMEM="2048M" - -# Whether to output commands for the plugin ConsoleLikeChat ($1 is the command to run) -FORMAT='$1' - -# Settings for backups -# =============================== - -# Location for world backups -BACKUPPATH="/home/${USERNAME}/mcbackup/worlds" - -# Where the whole minecraft directory is copied when whole-backup is executed -# whole-backup is a complete uncompressed backup of the whole server folder. -WHOLEBACKUP="/home/${USERNAME}/mcbackup/server" - -# Format for world backup (tar or zip). -BACKUPFORMAT="tar" - -# Normally backups will be put in a subfolder to $BACKUPPATH with todays date -# and the backups themselves will have a timestamp. - -# But if BACKUPSCRIPTCOMPATIBLE is set the world backups will be put directly -# in $BACKUPPATH without timestamp to be compatible with -# [backup rotation script](https://github.com/adamfeuer/rotate-backups) -# -BACKUPSCRIPTCOMPATIBLE=YES - -# If WORLDEDITCOMPATIBLE is set the world backups will be created compatible to WorldEdit -# in $BACKUPPATH as WORLD_NAME/DATE.(tar.bz2|zip) with the requested directory structure -# -# WORLDEDITCOMPATIBLE=YES - -# Compress the whole backup with bzip2? -# Note that this may not save a lot of disk space since there can be a lot of files -# in your server directory, that are already compressed, but it can slow down the -# backup a bit. This highly depends on the plugins you're using. -# -# For example: The png files generated by Dynmap are already compressed and still use -# a lot of space in your server directory, so the compression ratio of the compressed -# backup will not be very high. -COMPRESS_WHOLEBACKUP=YES - - -# Settings for log rolling -# =============================== - -# Location for old logs -# Used by the log-roll command -LOGPATH="/home/${USERNAME}/mcbackup/logs" - -# Whether or not to gzip logs (must be commented out for no - DO NOT CHANGE TO NO) -# -GZIPLOGS=YES - -# What to append to the logfile name (Leave blank for nothing) -LOGFILEAPPEND="logfile_" - - -# Settings for overviewer command -# =============================== - -# Where the Map is generated -OUTPUTMAP="/home/${USERNAME}/mc-overviewer/render" - -# Path to Minecraft-Overviewer -OVPATH="/home/${USERNAME}/mc-overviewer/Minecraft-Overviewer" - -# Path for the config file of Overviewer -OVCONFIGPATH="/home/${USERNAME}/mc-overviewer" - -# Name of Overviewer config file -OVCONFIGNAME="config.py" - -# Path for backup worlds -OVBACKUP="/home/${USERNAME}/mc-overviewer/overviewerbackups" - -# Things to leave alone ;) -# ===================== - -INVOCATION="java -Xmx$MAXMEM -Xms$INITMEM -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=$CPU_COUNT -XX:+AggressiveOpts -jar $SERVICE nogui" - -# Path to the the mounted ramdisk (the default will work in most senarios). -RAMDISK="/dev/shm" diff --git a/nginx-minecraft-overviewer b/nginx-minecraft-overviewer deleted file mode 100644 index bb47d48..0000000 --- a/nginx-minecraft-overviewer +++ /dev/null @@ -1,13 +0,0 @@ -server { - listen 80 default_server; - listen [::]:80 default_server ipv6only=on; - - root /home/notch/mc-overviewer/render; - index index.html; - - server_name mc-house-server; - - location / { - try_files $uri $uri/ =404; - } -} diff --git a/overviewer/Dockerfile b/overviewer/Dockerfile index 2c6ccc4..197c1b7 100644 --- a/overviewer/Dockerfile +++ b/overviewer/Dockerfile @@ -19,9 +19,5 @@ RUN mkdir -p /home/notch/.minecraft/versions/${MINECRAFT_VERSION} && \ VOLUME /map VOLUME /data ADD config.py / - -USER root -RUN echo "15,30,45,60 * * * * notch overviewer.py --config=/config.py >> /var/log/overviewer.log 2>&1" >> /etc/crontab && \ - touch /var/log/overviewer.log && \ - chown notch:users /var/log/overviewer.log -CMD cron && tail -f /var/log/overviewer.log \ No newline at end of file +ADD run-overviewer.sh / +CMD /run-overviewer.sh 15m diff --git a/overviewer/run-overviewer.sh b/overviewer/run-overviewer.sh new file mode 100755 index 0000000..691799a --- /dev/null +++ b/overviewer/run-overviewer.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +SLEEP=${1} + +overviewer.py --config=/config.py + +while [ ! -z ${SLEEP} ] ; do + while [ true ] ; do + sleep ${SLEEP} + overviewer.py --config=/config.py + done +done diff --git a/provision.sh b/provision.sh index 827109c..92d619f 100755 --- a/provision.sh +++ b/provision.sh @@ -19,12 +19,6 @@ docker run \ cd $(dirname $0)/overviewer && \ docker build -t overviewer . && \ - docker run \ - --rm \ - --volume ${MC_HOME}/minecraft:/data \ - --volume ${MC_HOME}/overviewer:/map \ - overviewer \ - su - notch -c "overviewer.py --config=/config.py" && \ docker run \ --detach \ --restart always \ @@ -40,4 +34,4 @@ docker run \ --name caddy \ --publish 8088:80 \ --volume ${MC_HOME}/overviewer:/var/www/html \ - zzrot/alpine-caddy \ No newline at end of file + zzrot/alpine-caddy