mc-server-runner

command module
v0.0.0-...-3a75031 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

README

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. The port is only needed for remote console functionality:

docker run -it --rm \
  -v ${PWD}:/build \
  -w /build \
  -p 2222:2222 \
  golang:1.19

Within that container, build/test by running:

go run . test/dump.sh
go run . test/bash-only.sh
# Used to test remote console functionality
# Connect to this using an ssh client from outside the container to ensure two-way communication works
go run . -remote-console /usr/bin/sh
# The following should fail
go run . --shell sh test/bash-only.sh

Using the devcontainer's Dockerfile

With IntelliJ

Create a "Go Build" run configuration

with a Dockerfile target

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL