Home / vendor / golang.org / x / sys / unix
Name Modified Size InfoDownloads / Week
Parent folder
aliases.go 2024-07-25 484 Bytes
asm_aix_ppc64.s 2024-07-25 420 Bytes
asm_bsd_386.s 2024-07-25 742 Bytes
asm_bsd_amd64.s 2024-07-25 785 Bytes
asm_bsd_arm64.s 2024-07-25 762 Bytes
asm_bsd_arm.s 2024-07-25 732 Bytes
asm_bsd_ppc64.s 2024-07-25 769 Bytes
asm_bsd_riscv64.s 2024-07-25 764 Bytes
asm_linux_386.s 2024-07-25 1.5 kB
asm_linux_amd64.s 2024-07-25 1.2 kB
asm_linux_arm64.s 2024-07-25 1.1 kB
asm_linux_arm.s 2024-07-25 1.1 kB
asm_linux_loong64.s 2024-07-25 1.2 kB
asm_linux_mips64x.s 2024-07-25 1.2 kB
asm_linux_mipsx.s 2024-07-25 1.2 kB
asm_linux_ppc64x.s 2024-07-25 962 Bytes
asm_linux_riscv64.s 2024-07-25 1.1 kB
asm_linux_s390x.s 2024-07-25 1.2 kB
asm_openbsd_mips64.s 2024-07-25 690 Bytes
asm_solaris_amd64.s 2024-07-25 436 Bytes
bluetooth_linux.go 2024-07-25 680 Bytes
constants.go 2024-07-25 390 Bytes
dev_aix_ppc64.go 2024-07-25 878 Bytes
dev_aix_ppc.go 2024-07-25 757 Bytes
dev_darwin.go 2024-07-25 747 Bytes
dev_dragonfly.go 2024-07-25 1.0 kB
dev_freebsd.go 2024-07-25 1.0 kB
dev_netbsd.go 2024-07-25 913 Bytes
dev_openbsd.go 2024-07-25 918 Bytes
dev_zos.go 2024-07-25 850 Bytes
endian_big.go 2024-07-25 421 Bytes
endian_little.go 2024-07-25 470 Bytes
env_unix.go 2024-07-25 717 Bytes
fcntl.go 2024-07-25 1.1 kB
fcntl_darwin.go 2024-07-25 806 Bytes
fcntl_linux_32bit.go 2024-07-25 500 Bytes
fdset.go 2024-07-25 853 Bytes
gccgo_linux_amd64.go 2024-07-25 464 Bytes
pagesize_unix.go 2024-07-25 457 Bytes
ptrace_darwin.go 2024-07-25 482 Bytes
ptrace_ios.go 2024-07-25 420 Bytes
race0.go 2024-07-25 643 Bytes
race.go 2024-07-25 675 Bytes
readdirent_getdents.go 2024-07-25 454 Bytes
readdirent_getdirentries.go 2024-07-25 715 Bytes
sockcmsg_dragonfly.go 2024-07-25 544 Bytes
sockcmsg_unix_other.go 2024-07-25 1.3 kB
syscall_aix_ppc.go 2024-07-25 1.4 kB
syscall_darwin_libSystem.go 2024-07-25 1.3 kB
syscall_dragonfly_amd64.go 2024-07-25 1.3 kB
syscall_freebsd_386.go 2024-07-25 1.5 kB
syscall_freebsd_amd64.go 2024-07-25 1.5 kB
syscall_freebsd_arm64.go 2024-07-25 1.4 kB
syscall_freebsd_arm.go 2024-07-25 1.4 kB
syscall_freebsd_riscv64.go 2024-07-25 1.4 kB
syscall_hurd.go 2024-07-25 650 Bytes
syscall_hurd_386.go 2024-07-25 466 Bytes
syscall_linux_alarm.go 2024-07-25 534 Bytes
syscall_linux_amd64_gc.go 2024-07-25 315 Bytes
syscall_linux_gc.go 2024-07-25 514 Bytes
syscall_linux_gc_386.go 2024-07-25 608 Bytes
syscall_linux_gc_arm.go 2024-07-25 434 Bytes
syscall_linux_gccgo_386.go 2024-07-25 1.0 kB
syscall_linux_gccgo_arm.go 2024-07-25 622 Bytes
syscall_netbsd_386.go 2024-07-25 840 Bytes
syscall_netbsd_amd64.go 2024-07-25 837 Bytes
syscall_netbsd_arm64.go 2024-07-25 837 Bytes
syscall_netbsd_arm.go 2024-07-25 840 Bytes
syscall_openbsd_386.go 2024-07-25 1.0 kB
syscall_openbsd_amd64.go 2024-07-25 1.0 kB
syscall_openbsd_arm64.go 2024-07-25 1.0 kB
syscall_openbsd_arm.go 2024-07-25 1.0 kB
syscall_openbsd_libc.go 2024-07-25 1.1 kB
syscall_openbsd_mips64.go 2024-07-25 955 Bytes
syscall_openbsd_ppc64.go 2024-07-25 1.0 kB
syscall_openbsd_riscv64.go 2024-07-25 1.0 kB
syscall_solaris_amd64.go 2024-07-25 617 Bytes
syscall_unix_gc.go 2024-07-25 733 Bytes
syscall_unix_gc_ppc64x.go 2024-07-25 839 Bytes
sysvshm_linux.go 2024-07-25 537 Bytes
sysvshm_unix.go 2024-07-25 1.5 kB
sysvshm_unix_other.go 2024-07-25 420 Bytes
unveil_openbsd.go 2024-07-25 1.1 kB
zptrace_armnn_linux.go 2024-07-25 1.2 kB
zptrace_linux_arm64.go 2024-07-25 721 Bytes
zptrace_mipsnn_linux.go 2024-07-25 1.4 kB
zptrace_mipsnnle_linux.go 2024-07-25 1.5 kB
Totals: 87 Items   76.1 kB 0

Minecraft Server Hibernation

msh - loc msh - release msh - goreport msh - license msh - stars

Avoid wasting resources by starting your Minecraft server automatically when a player joins and stopping it when no one is online
(for vanilla/modded on linux/windows/macos)

version: v2.5.0
Copyright (C) 2019-2023 gekigek99

Join our discord server!


RELEASES:

Download the latest releases on github (for linux, windows and macos)

You can download msh from gekware or compile the dev branch to use a more recent version, but note that it may still need to be tested


PROGRAM COMPILATION:

This version was successfully compiled in go version 1.19
Compilation procedure:

git clone https://github.com/gekware/minecraft-server-hibernation.git  
cd minecraft-server-hibernation/  
git submodule update --init
git checkout dev # execute only if you want to compile the dev branch
go build .

INSTRUCTIONS:

  1. Install the Minecraft server you want
  2. Edit msh-config.json as needed (check definitions):
    • Folder
    • FileName
    • StartServerParam
    • StopServer
    • Whitelist
    • * TimeBeforeStoppingEmptyServer
    • * others...
  3. * put the frozen icon you want in path/to/server.jar/folder (must be called server-icon-frozen, supported formats: .png, .jpg)
  4. on the router (to which the server is connected): forward port 25555 to server (tutorial)
  5. on the server: open port 25555 (example: ufw firewall)
  6. run the msh executable
  7. You can connect to the server using the port from the configuration file (default 25555).

* = it's not compulsory to modify this parameter

notes

  • msh-config.json is not generated automatically. You will need to download it from the releases.
  • Automatically run msh at reboot.
  • In server.properties set server-ip=0.0.0.0 to avoid errors when msh tries to connect to the minecraft server.
  • You must remove all braces from msh-config.json.

DEFINITIONS:

  • Some of these parameters can be configured with command-line arguments (msh --help to know more) (user supplied arguments will override config)

Location of server folder and executable. You can find protocol/version here (but msh should set them automatically):

"Server": {
  "Folder": "{path/to/server/folder}"
  "FileName": "{server.jar}"
  "Version": "1.19.2"
  "Protocol": 760
}

Commands to start and stop minecraft server
StopServerAllowKill allows to kill the server after a certain amount of time (in seconds) when it's not responding

"Commands": {
  "StartServer": "java <Commands.StartServerParam> -jar <Server.FileName> nogui"
  "StartServerParam": "-Xmx1024M -Xms1024M"
  "StopServer": "stop"
  "StopServerAllowKill": 10 # set to -1 to disable
}

Set the logging level for debug purposes

"Debug": 1
# 0 - NONE: no log
# 1 - BASE: basic log
# 2 - SERV: minecraft server log
# 3 - DEVE: developement log
# 4 - BYTE: connection bytes log

Ports configuration - MshPort and MshPortQuery must be different from the respective ones in server.properties - query handling is enabled if EnableQuery: true in msh-config.json AND enable-query=true in server.properties

"MshPort": 25555        # port to which players can join
"MshPortQuery": 25555   # port to which stats query requests are performed from clients
"EnableQuery": true     # enable query handling

TimeBeforeStoppingEmptyServer sets the time (after the last player disconnected) that msh waits before hibernating the minecraft server

"TimeBeforeStoppingEmptyServer": 30

SuspendAllow enables msh to suspend minecraft server process when there are no players online
To mitigate ram usage you can set a high swappiness (on linux)
- pro: player wait time to join frozen server is ~0
- cons: ram usage as minecraft server without msh (cpu remains ~0)

SuspendRefresh enables refresh of minecraft server suspension every set seconds (to avoid watchdog crash at unsuspension)
- setting these variables and SuspendRefresh might prevent minecraft server watchdog crash when SuspendAllow is enabled

file variable
server.properties max-tick-time= -1
spigot.yml timeout-time: -1, restart-on-crash: false
bukkit.yml warn-on-overload: false
paper-global.yml early-warning-delay: -1, early-warning-every: -1
"SuspendAllow": false
"SuspendRefresh": -1    # set -1 to disable, advised value: 120 (reduce if minecraft server keeps crashing)

Hibernation and Starting server description

"InfoHibernation": "                   §fserver status:\n                   §b§lHIBERNATING"
"InfoStarting": "                   §fserver status:\n                    §6§lWARMING UP"

Set to false if you don't want notifications (every 20 minutes)

"NotifyUpdate": true
"NotifyMessage": true

Whitelist contains IPs and player names that are allowed to start the server (leave empty to allow everyone)
WhitelistImport adds whitelist.json to player names that are allowed to start the server
unknown clients are not allowed to start the server, but can join

"Whitelist": ["127.0.0.1", "gekigek99"]
"WhitelistImport": false

ShowResourceUsage enables the logging of the msh tree process cpu/ram usage percent
for debug purposes (debug level 3 required)

"ShowResourceUsage": false

ShowInternetUsage enables the logging of the msh connection usage
for debug purposes (debug level 3 required)

"ShowInternetUsage": false

CREDITS:

Author: gekigek99

Contributors: najtin, f8ith, Br31zh, someotherotherguy, navidmafi, cromefire, andreblanke, KyleGospo, A-wels, dxomg

Docker branch (outdated): lubocode

Pterodactyl egg: BolverBlitz

If you wish to contribute, please create a pull request using the dev branch as the base for your changes


Give a star to this repository on github!

Source: README.md, updated 2024-07-25