Ats192 / mc-server-runner

A container entry point to manage graceful shutdown of a Minecraft server

Home Page:mc-server-runner-9sst.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub release (latest SemVer) Test

This is a process wrapper used by the itzg/minecraft-server Docker image to ensure the Minecraft server is stopped gracefully when the container is sent the TERM signal.

Usage

Available at any time using -h

  -bootstrap string
        Specifies a file with commands to initially send to the server
  -debug
        Enable debug logging
  -detach-stdin
        Don't forward stdin and allow process to be put in background
  -shell string
        When set, pass the arguments to this shell
  -stop-duration duration
        Amount of time in Golang duration to wait after sending the 'stop' command.
  -stop-server-announce-delay duration
        Amount of time in Golang duration to wait after announcing server shutdown

Development Testing

Start a golang container for building and execution:

docker run -it --rm \
  -v ${PWD}:/build \
  -w /build \
  circleci/golang:1.12

Within that container, build/test by running:

go run main.go test/dump.sh
go run main.go test/bash-only.sh
# The following should fail
go run main.go --shell sh test/bash-only.sh

About

A container entry point to manage graceful shutdown of a Minecraft server

mc-server-runner-9sst.vercel.app

License:Apache License 2.0


Languages

Language:Go 86.5%Language:Dockerfile 12.3%Language:Shell 1.2%