EzRestart
一款轻量级的服务端 Fabric 模组,可在不踢出任何玩家的情况下重启服务器。EzRestart 不会在固定时间停止服务器,而是将服务器标记为待重启状态,并等待服务器变为空载后再执行重启,从而确保玩家会话不会被中断。
工作原理
每天在可配置的时间(默认为 04:00,支持可选时区设置),服务器会自动被标记。当玩家数量降至零时,服务器将干净地关闭,随后你的包装脚本或主机面板会将其重新启动。如果关闭过程卡住,看门狗机制会在可配置的超时后强制 JVM 退出,以防止服务器处于半停止状态。
命令
/ezrestart flag -- 标记服务器,以便在下次空载时重启
/ezrestart cancel -- 清除待处理的重启标记
/ezrestart status -- 显示当前标记和设置状态
/ezrestart reload -- 从磁盘重新加载配置文件
/ezrestart set time <HH:mm> -- 设置每日重启时间(24小时制,例如 22:30)
/ezrestart set auto <true|false> -- 切换每日自动标记功能
/ezrestart set timezone <zone> -- 设置调度时区(IANA ID,如 America/New_York,或 system)
/ezrestart set timeout <seconds> -- 设置关闭看门狗的超时时间(设为 0 则禁用该功能)
这些命令使用 Fabric Permissions API 节点 (ezrestart.command.*),并回退到原版 OP 等级权限。
配置
设置位于 config/ezrestart.json 中,也可以通过游戏内的 set 子命令进行修改。
注意事项
EzRestart 负责停止服务器;需要其他机制来重新启动它。请在退出时自动重启的包装脚本、systemd 单元文件或启用了自动重启的主机面板下运行本模组。
EzRestart
A lightweight, server-side Fabric mod that restarts your server without kicking anyone. Instead of stopping at a fixed time, EzRestart flags the server for a restart and then waits until it is empty, so players never get interrupted mid-session.
How it works
Once per day at a configurable time (default 04:00, with an optional timezone setting), the server is automatically flagged. The next time the player count hits zero, the server shuts down cleanly and your wrapper script or host panel brings it back up. If the shutdown hangs, a watchdog forces the JVM to exit after a configurable timeout so the server never gets stuck half-stopped.
Commands
/ezrestart flag -- flags the server to restart the next time it is empty
/ezrestart cancel -- clears a pending restart flag
/ezrestart status -- shows the current flag and settings
/ezrestart reload -- reloads the config from disk
/ezrestart set time <HH:mm> -- sets the daily restart time (24hr e.g. 22:30)
/ezrestart set auto <true|false> -- toggles the daily auto-flag
/ezrestart set timezone <zone> -- sets the scheduling timezone (IANA id like America/New_York, or system)
/ezrestart set timeout <seconds> -- sets the shutdown watchdog timeout (0 disables it)
Commands use Fabric Permissions API nodes (ezrestart.command.*) and fall back to vanilla OP levels.
Configuration
Settings live in config/ezrestart.json and can also be changed in-game with the set subcommands.
Notes
EzRestart stops the server; something else has to start it again. Run it under a restart-on-exit wrapper script, systemd unit, or a host panel with auto-restart enabled.
评论 0
登录后参与评分
还没有评论,来抢沙发吧