Conor Buckley


Launch Minecraft Server (launchMinecraftServer)

Description

launchMinecraftServer is a Bash script and SystemD service to start and stop your Minecraft server with SystemD and scale the amount of slots with the amount of available R.A.M.

Usage Instructions

Extract the tarball to /; the SystemD unit will be installed at '/etc/systemd/system/minecraft.service' and the Bash script will be installed at '/usr/local/bin/launchMinecraftServer' with execute permissions already set.

SystemD Unit Variables

You may want to modify the SystemD unit to match your Minecraft server installation.

Bash Script Variables

reservedRAM

The amount of R.A.M. in KiB which is reserved for other applications. The total amount of R.A.M. which can be used by Minecraft is taken by deducting this number from the total available R.A.M.

minimumRAM

If the total amount of R.A.M. minus the 'reservedRAM' is less than this number (in KiB), do not run the Minecraft server.

RAMForTwoPlayers

The amount of R.A.M. (in KiB) required before more than one slot is usable on the server.

RAMPerPlayer

The amount of R.A.M. required for each player slot above 2 players.

defaultMinecraftJarPath

The path to the Minecraft server jar that will be used if the 'minecraftJarPath' variable is not set.

serverPropertiesFilePath

The Bash script modifies the 'server.properties' file in order to control how many slots the server uses. The path of the 'server.properties' file is set in the 'serverPropertiesFilePath' variable. If your 'server.properties' file is in a different location, just change the path in this variable.

Dependencies

Ensure the following commands are available:

Core utilities such as 'rm' are assumed. I used Bash version 4.4.12(1)-release but other relatively new versions should be fine as well.

Download

Note that all files provided below for download are encapsulated in a G.P.G. signature made using my 'Conor Andrew Buckley' key pair. To download my 'Conor Andrew Buckley' key pair, visit the 'Contact and Authentication' page.

Version Licence Type Last Updated (YYYY-MM-DD) Notes
2 2-Clause B.S.D. Licence 2018-08-26 This version is broken and only available for historical purposes.
3 2-Clause B.S.D. Licence 2018-09-04