Help with operating systems, apps, and software-related issues.
-
ccb056
- Site Administrator
- Posts: 1003
- Joined: January 14th, 2004, 11:36 pm
- Location: Texas
Post
by ccb056 »
https://www.minecraft.net/en-us/download/server/bedrock
Download binary to /bin/minecraft
Code: Select all
unzip bedrock-server-1.21.131.1.zip
if you see
NO LOG FILE! - Failed to up file descriptor limit Operation not permitted
check:
real-time non-blocking time (microseconds, -R) unlimited
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 2062520
max locked memory (kbytes, -l) 8192
max memory size (kbytes, -m) unlimited
open files (-n) 4096
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 2000
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
fix (temporary):
Run on boot:
Code: Select all
chmod +x ~/.config/minecraft/start
Code: Select all
#!/bin/bash
# start
ulimit -n 4096
cd ~/bin/minecraft
tmux new -d -s minecraft './bedrock_server'
to start:
to run on boot:
to list:
to attach:
to detach:
to stop:
-
ccb056
- Site Administrator
- Posts: 1003
- Joined: January 14th, 2004, 11:36 pm
- Location: Texas
Post
by ccb056 »
Code: Select all
vi ~/.config/minecraft/update-bedrock.sh
Code: Select all
#!/usr/bin/env bash
set -euo pipefail
HOME_DIR="$HOME"
INSTALL_DIR="$HOME_DIR/bin/minecraft"
TMP_DIR="$HOME_DIR/bedrock-tmp"
API_URL="https://net-secondary.web.minecraft-services.net/api/v1.0/download/links"
ZIP_NAME="bedrock.zip"
command -v jq >/dev/null || { echo "jq is required"; exit 1; }
echo "Fetching version info..."
DATA=$(curl -fsSL "$API_URL")
DOWNLOAD_URL=$(echo "$DATA" | jq -r '.result.links[] | select(.downloadType == "serverBedrockLinux") | .downloadUrl')
VERSION=$(basename "$DOWNLOAD_URL" | grep -o '[0-9.]\+')
[[ -z "$DOWNLOAD_URL" || -z "$VERSION" ]] && { echo "Failed to extract URL/version"; exit 1; }
[[ -f "$INSTALL_DIR/bedrock-server.version" && "$(cat "$INSTALL_DIR/bedrock-server.version")" == "$VERSION" ]] && {
echo "Already up to date"
exit 0
}
mkdir -p "$TMP_DIR"
wget -q -O "$TMP_DIR/$ZIP_NAME" "$DOWNLOAD_URL"
unzip -t "$TMP_DIR/$ZIP_NAME" >/dev/null || { echo "ZIP test failed"; exit 1; }
unzip -oq "$TMP_DIR/$ZIP_NAME" -d "$TMP_DIR/unpacked"
[[ -x "$TMP_DIR/unpacked/bedrock_server" ]] || { echo "Missing server binary"; exit 1; }
rsync -a \
--exclude='autoupdate.sh' \
--exclude='server.properties' \
--exclude='permissions.json' \
--exclude='whitelist.json' \
--exclude='ops.json' \
--exclude='allowlist.json' \
--exclude='valid_known_packs.json' \
--exclude='worlds/' \
"$TMP_DIR/unpacked/" "$INSTALL_DIR/"
echo "$VERSION" > "$INSTALL_DIR/bedrock-server.version"
rm -rf "$TMP_DIR"
echo "Updated to version $VERSION"
Code: Select all
chmod +x ~/.config/minecraft/update-bedrock.sh