Minecraft Server Suite has these features:
-
Use systemd to control the status of any number of Minecraft servers
-
Open a tmux session for each Minecraft server so its i/o can be accessed
- Include an automatic snapshot solution that:
- Keeps all yearly snapshots
- Keeps all monthly snapshots
- Keeps the last 4 weekly snapshots
- Keeps the last 7 daily snapshots
- Keeps the last 24 hourly snapshots
- Keeps the last 4 quarter-hourly snapshots
- Keeps the last 5 minute snapshots
- In /etc/passwd, create a system user (login shell is usr/sbin/nologin) called minecraft with home /home/minecraft.
minecraft:x:1001:1001:Minecraft Server:/home/minecraft:/usr/sbin/nologin
- In /etc/group, create group minecraft and add your user to the group
minecraft:x:1001:jackharro
Important: for the minecraft user to maintain rwX access to files created by your user in /home/minecraft, we need to edit the ACL and set the group sticky bit
-
If /home/minecraft has any files, back it up and remove /home/minecraft
-
# mkdir /home/minecraft && chown minecraft:minecraft /home/minecraft
-
chmod ug=rw,g+s,o=- /home/minecraft
-
setfacl -m d:u::rwX,d:g::rwX,d:o::- /home/minecraft
See the output of ls -l /home/minecraft
for the effect of the ACL when files are made by your user:
TODO
If you have issues with minecraft reading files created by your user, ensure that the getfacl
output of that directory is something like this:
TODO
And change it if it isn't.
By default, this installs files named:
/usr/local/bin/minecraft-server-ctl
/usr/local/bin/minecraft-server-backup
/etc/systemd/system/minecraft@.service
/etc/cron.d/minecraft-backup.conf
To install to /usr/local/bin, /etc/systemd/system and /etc/cron.d:
# make install
OR
# DESTDIR=/usr/bin make install
make will:
- Move all non-minecraftctl files to target
- Concatenate the files in src/ into target/minecraftctl
- Set appropriate permissions to target/*
- mv target/minecraftctl $BIN_DIR
- mv target/minecraft@.service $SYSTEMD_DIR/system
- mv target/minecraft-backup.conf $CRON_DIR
# systemctl start|stop|restart|enable minecraft@<version>
Enabling a server will start the Minecraft server when the computer is turned on.
You will have to `port' the service if your initd is not systemd. PRs for different initds will be accepted.
The backup is automatic and follows the rules outlined above. Running make install
turns on the snapshot