What Is Minecraft Server Systemd Services?
Systemd unit files for use with the Minecraft Server and associated services (backup and stats).
- Supports use with Minecraft server software PaperMC, SpigotMC and Vanilla.
- Backup the Minecraft server directory.
- To an archive.
- Sync to a desired destination.
- Sync Minecraft stats data to MinecraftStats.
- Have an understanding of general server practices.
- Have experienced working knowledge within a CLI (command-line interface).
- Installed all required dependencies as stated in System Requirements section.
- Dependencies are accessible via environment PATH.
- Installation is done via Linux CLI.
- Steps prefixed with a "$" (dollar sign) represents the CLI prompt. The text after the "$" is to be entered at the CLI.
- Steps prefixed with a "#" (number sign) represents the CLI prompt with elevated user permissions (e.g. root). The text after the "#" is to be entered at the CLI.
- A single backslash character beside another character is used to escape the proceeding character. In this case backslash character is not to to be entered at the CLI.
- These instructions are an example of installation and configuration.
- Change to your home directory.
$ cd ~
- Download the project.
$ git clone https://gitlab.com/adouglas/minecraft-systemd-services.git
- Change to the project directory.
$ cd minecraft-systemd-services
- Copy Systemd unit files.
# cp minecraft-* /etc/systemd/system/
minecraft-backup.service minecraft-backup.timer minecraft-paper.service minecraft-spigot.service minecraft-stats.service minecraft-stats.timer minecraft-vanilla.service
- Edit each applicable unit file(s).
- Ensure paths are correct (ReadWriteDirectories, WorkingDirectory, ExecStart, ExecStop).
- Ensure timers property "OnCalendar" is set as desired.
$ nano minecraft-backup.service
- Set file permissions.
# chmod 644 /etc/systemd/system/minecraft-*
- Set file ownership and group.
# chown root:root /etc/systemd/system/minecraft-*
- Add user base upon "User" unit property value.
# useradd -r -s /bin/bash minecraft
-r create a system account. -s user's login shell.
- Add group based upon "Group" unit property value.
- Note: This step is only required if group name differs from username.
# groupadd minecraft # usermod -a minecraft minecraft
-a add the user to supplementary group.
- Enable services.
# systemctl enable minecraft-paper.service # systemctl enable minecraft-backup.timer # systemctl enable minecraft-stats.timer
For an even simpler usage at the CLI run "wardenctl help" without double quotes.
Useful Command Examples
|Reload all unit files||systemctl daemon-reload||Required after modifying unit file(s).|
|Restart unit||systemctl restart minecraft-paper.service|
|Start unit||systemctl start minecraft-paper.service|
|Stop unit||systemctl stop minecraft-paper.service|
|View unit status||systemctl status minecraft-paper.service|
|View unit messages||journalctl -u minecraft-paper.service|
|View unit messages||journalctl -fu minecraft-paper.service||View most recent entries and follow new entries as they occur. Press CTRL-C to quit.|
Minecraft Server Systemd Services is licensed under the GNU General Public License v3.0. Review the license by viewing the LICENSE file.
Copyright (c) 2019-2020 Adam Douglas Some Rights Reserved