Server minecraft arch linux

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Docker build script for Arch Linux base with Minecraft Java server

License

binhex/arch-minecraftserver

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Application

Description

Minecraft is a sandbox video game created by Swedish game developer Markus Persson and released by Mojang in 2011. The game allows players to build with a variety of different blocks in a 3D procedurally generated world, requiring creativity from players. Other activities in the game include exploration, resource gathering, crafting, and combat. Multiple game modes that change gameplay are available, including—but not limited to—a survival mode, in which players must acquire resources to build the world and maintain health, and a creative mode, where players have unlimited resources to build with.

Build notes

Latest stable Minecraft Java release from Mojang.

docker run -d \ -p :8222/tcp \ -p :25565 \ --name= \ -v :/config \ -v /etc/localtime:/etc/localtime:ro \ -e CREATE_BACKUP_HOURS= \ -e PURGE_BACKUP_DAYS= \ -e ENABLE_WEBUI_CONSOLE= \ -e ENABLE_WEBUI_AUTH= \ -e WEBUI_USER= \ -e WEBUI_PASS= \ -e WEBUI_CONSOLE_TITLE= \ -e CUSTOM_JAR_PATH= \ -e JAVA_VERSION= <8|11|latest>\ -e JAVA_INITIAL_HEAP_SIZE= \ -e JAVA_MAX_HEAP_SIZE= \ -e JAVA_MAX_THREADS= \ -e STARTUP_CMD= \ -e UMASK= \ -e PUID= \ -e PGID= \ binhex/arch-minecraftserver 

Please replace all user variables in the above command defined by <> with the correct values.

Access Minecraft Server console

Requires -e ENABLE_WEBUI_CONSOLE=yes

docker run -d \ -p 8222:8222/tcp \ -p 25565:25565 \ --name=minecraftserver \ -v /apps/docker/minecraftserver:/config \ -v /etc/localtime:/etc/localtime:ro \ -e CREATE_BACKUP_HOURS=12 \ -e PURGE_BACKUP_DAYS=14 \ -e ENABLE_WEBUI_CONSOLE=yes \ -e ENABLE_WEBUI_AUTH=yes \ -e WEBUI_USER=admin \ -e WEBUI_PASS=minecraft \ -e WEBUI_CONSOLE_TITLE='Minecraft Server' \ -e CUSTOM_JAR_PATH=/config/minecraft/paperclip.jar \ -e JAVA_VERSION=latest \ -e JAVA_INITIAL_HEAP_SIZE=512M \ -e JAVA_MAX_HEAP_SIZE=1024M \ -e JAVA_MAX_THREADS=1 \ -e STARTUP_CMD=gamerule reducedDebugInfo true \ -e UMASK=000 \ -e PUID=0 \ -e PGID=0 \ binhex/arch-minecraftserver 

If you do NOT want world backups and/or purging of backups then set the value to ‘0’ for env vars ‘CREATE_BACKUP_HOURS’ and/or ‘PURGE_BACKUP_DAYS’.

Env var ‘CUSTOM_JAR_PATH’ is optional and allows you to define a specific jar to run, if not specified then the latest Mojang Minecraft jar will be used.

Env vars ‘JAVA_INITIAL_HEAP_SIZE’ value and ‘JAVA_MAX_HEAP_SIZE’ values must be a multiple of 1024 and greater than 2MB.

User ID (PUID) and Group ID (PGID) can be found by issuing the following command for the user you want to run the container as:-

If you appreciate my work, then please consider buying me a beer 😀

Источник

Arch Linux User Repository

To get an overview of the available options provided by the management script, be sure to have a look at the help page or read the according section on the ArchWiki article [1].

You can quit the console without shutting down the server by press ctrl+a d (first ctrl+a and after releasing the buttons press d; ctrl+b also works). This will detach your input from the server console. The attaching and detaching is done with tmux (previously GNU screen) since it lets you view and type into the console, send single commands to it and keep it alive without a connected user. Take a look at the the command overview at the ArchWiki [2] to get a feel for its power. (@carmelo12341)

Latest Comments

edh commented on 2022-02-19 22:01 (UTC) (edited on 2022-02-19 22:07 (UTC) by edh)

@bronze Regarding the JDK issue, I feel uncomfortable removing the version requirement. I think the best approach would be to add versions to the provides of the jdk package such that the version criteria are fulfilled for this package. What do you think?

Concerning the Minecraft server management script, yes it indeed has been moved to its own repository. However, all the configuration is done during «build» time. To be specific, make configures everything. See the corresponding Makefile. Because it currently needs to be adapted to a specific server at build time, it does not make sense to package it on its own in a separate package. The script really is just a small management script and IMHO it is not worth making some kind of pluggable library out of it that could be depended on. If you have an idea of how to provide a sensible management script package, I am happy to create and maintain it.

EDIT: In case you just want a dirty hack to not install the server but everything else, simply set /srv/minecraft to be ignored during installation by pacman, see https://wiki.archlinux.org/title/Pacman#Skip_files_from_being_installed_to_system .

bronze commented on 2022-02-19 20:48 (UTC) (edited on 2022-02-19 20:50 (UTC) by bronze)

I have JDK8 installed but this PKGBUILD still needs java-17-openjdk. I only need the script (and the minecraft user, etc. But not any of the servers). I see the management script has been moved to a dedicated repo. Is the management scrip in the AUR somewhere?

edh commented on 2021-12-22 15:31 (UTC)

The management script to control this minecraft flavor was moved to a dedicated repository at GitHub:Edenhofer/minecraft-server. The script works for various flavors of minecraft. It is very minimalist yet versatile and feature-rich. For more information on how to configure and install the script separately, visit the above linked repository.

@Ionble Forking the management script off the minecraft-server has long been on my TODO list. I finally took the time to implement this. See the above notice for a link to the new repository.

lonble commented on 2021-12-22 06:19 (UTC)

Can you indicate the exact upstream of the script and systemd unit? So that I can build this package on other distros.

edh commented on 2021-12-02 08:52 (UTC)

These exact commands (together with a save-all ) are already issued, see here. Furthermore, an explicit $ sync is issued. My best guess is that save-all involves complications in addition to the mere saving and thus sync thus not catch them all, i.e. does not wait.

I am happy to incorporate any new ideas of how to rectify this situation but I am unfortunately not aware of a good solution. The only thing I can think of is incorporating a small delay between save-all and $ sync

acoccimi commented on 2021-12-02 08:12 (UTC)

When backing up a running server with minecraftd-backup, I noticed that the tar command had output «file changed as we read it». This suggests that files are being modified by the running server during the backup, and I’m a bit concerned that this would result in corruption when the backup is restored.

Would it be possible for the script to do save-off and save-all prior to doing the backup, and then do save-on afterward?

edh commented on 2021-11-10 10:59 (UTC)

@Xarius No, the backup logic should not have changed. Note, triggering new backups is purely a systemd thing and the configuration is exclusively handled by systemd timers. As long as you configure them in /etc and not in /usr/lib/ your changes will not be overridden by an update.

Xarius commented on 2021-11-10 00:25 (UTC)

Did something change with how backups are handled recently? I had them set to be hourly, and they reverted to being daily after the last update. But, now when I try to enable the backup system service, it claims it doesn’t exist? Highly likely I’m just forgetting something simple here.

edh commented on 2021-10-18 16:00 (UTC)

@DragonX256 hmm I changed the login shell about a year ago to /bin/bash in the corresponding .sysusers file. The commit is from 3 October 2020 11:48 UTC+2 to be precise. However, I have to admit I forgot why I made this change.

You may safely edit /etc/passwd and adapt the shell. The sysusers entry should already be correct.

DragonX256 commented on 2021-10-18 15:51 (UTC)

Well okay, I had to delete package and minecraft user and reinstall package again to let systemd correctly create user with proper uid and gid. Issue is resolved to me.

Copyright © 2004-2023 aurweb Development Team.

AUR packages are user produced content. Any use of the provided files is at your own risk.

Источник

Setup Spigot Server on Arch Linux

This tutorial explains how to set up a Minecraft server using Spigot on Arch Linux.

This tutorial assumes that you are a normal user (not-root) and have sufficient rights to sudo. This is because using the AUR to build packages should not be done as root, but as a normal user.

Installation

Using the AUR package «spigot» is a great way to install Spigot as it builds a package that is tracked by pacman. This allows you to remove it quickly and upgrade it quickly. Plus, the package uses systemd and tmux to manage the server, and it has all of the scripts ready for you to use.

Before we begin building the package, we need to install some dependencies first.

sudo pacman -Sy base-devel jdk8-openjdk jre8-openjdk fontconfig tmux git 

Now with those installed, we can begin to build the spigot package. Using curl, download the tarball for the package.

curl -O https://aur.archlinux.org/packages/sp/spigot/spigot.tar.gz 

After the download finishes, extract it and change into the spigot folder.

tar -xvzf spigot.tar.gz cd spigot 

Now, using makepkg, build the package. This can take a few minutes.

If you didn’t pass the -i flag to the makepkg command, you use pacman to install it.

Start your server for the first time to gain access to the eula.txt file. Then, immediately stop it.

sudo systemctl start spigot sudo systemctl stop spigot 

After that’s done, open the file /srv/craftbukkit/eula.txt and change the line eula=false to eula=true . This provides you with a working server, but you may still want to modify the /srv/craftbukkit/server.properties file. Information about this file can be found on the Minecraft Wiki.

Once you are happy with your settings, fire up the server!

sudo systemctl start spigot 
sudo systemctl enable spigot 

You now have a working Spigot server!

Extra Information

The contents of the server are located in /srv/craftbukkit/ and are owned by the user craftbukkit and group craftbukkit. You must make sure when installing plugins or other files that they are owned by craftbukkit:craftbukkit.

If you want to access the server console, run the following command (assuming that you have the correct sudo permissions).

sudo -u craftbukkit tmux attach 

To close out of the server console, press Ctrl + B, then D.

Another thing to consider is if you want to allocate more RAM to the server. If so, run the following command. The $newram placeholder is where you specify the new value. This will also create a backup file in case you need to revert to it.

sudo -u craftbukkit sed -i.bak 's/1024M/$newram/g' /srv/craftbukkit/spigot.sh 

If you put in a bad value for the new amount of ram, you can revert by running this command.

sudo -u craftbukkit mv /srv/craftbukkit/spigot.sh.bak /srv/craftbukkit/spigot.sh 

Want to contribute?

You could earn up to $600 by adding new articles.

Источник

Читайте также:  Linux алгоритм хеширования пароля
Оцените статью
Adblock
detector