tidy the file tree
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
b43527c
|
||||
60176fa
|
||||
8cd942b
|
||||
@@ -15,17 +15,17 @@ Minecraft 服务器守护进程
|
||||
|
||||
```bash
|
||||
# 复制文件
|
||||
mkdir -p /opt/minecraft/sentinel
|
||||
cp main.rb method_executor.rb server_status_detector.rb systemd_notifier.rb config.rb updates.rb /opt/minecraft/sentinel/
|
||||
mkdir -p /opt/minecraft/sentinel/src
|
||||
cp src/main.rb src/method_executor.rb src/server_status_detector.rb src/systemd_notifier.rb src/config.rb src/updates.rb /opt/minecraft/sentinel/src/
|
||||
|
||||
# 安装 systemd 服务
|
||||
cp minesentinel.service /etc/systemd/system/
|
||||
cp src/minesentinel.service /etc/systemd/system/
|
||||
systemctl daemon-reload
|
||||
systemctl enable minesentinel
|
||||
systemctl start minesentinel
|
||||
|
||||
# 手动运行(调试用)
|
||||
cd /opt/minecraft/sentinel
|
||||
cd /opt/minecraft/sentinel/src
|
||||
ruby main.rb
|
||||
```
|
||||
|
||||
@@ -68,7 +68,7 @@ MineSentinel 通过 `Before=minecraft.service` 确保先于 MC 启动,避免 M
|
||||
|
||||
## 完整文档
|
||||
|
||||
参见 [DEPLOY.md](DEPLOY.md) 或 [官网](OfficialWebsite/index.html)。
|
||||
参见 [DEPLOY.md](docs/DEPLOY.md) 或 [官网](static/index.html)。
|
||||
|
||||
## 许可证
|
||||
|
||||
|
||||
+13
-12
@@ -20,12 +20,13 @@ MineSentinel 是一个 Minecraft 服务器守护进程,每 1.5 秒检测服务
|
||||
|
||||
```
|
||||
/opt/minecraft/sentinel/ # 推荐部署目录
|
||||
├── main.rb # 主程序入口 —— 检测循环 + 冷却期 + 初始宽限期
|
||||
├── method_executor.rb # 日志系统 + 重启逻辑 + 重试计数器
|
||||
├── server_status_detector.rb # TCP 端口检测模块
|
||||
├── systemd_notifier.rb # systemd watchdog 心跳发送
|
||||
├── config.rb # 可调参数配置
|
||||
└── updates.rb # 更新检查模块
|
||||
└── src/ # 源码目录
|
||||
├── main.rb # 主程序入口 —— 检测循环 + 冷却期 + 初始宽限期
|
||||
├── method_executor.rb # 日志系统 + 重启逻辑 + 重试计数器
|
||||
├── server_status_detector.rb # TCP 端口检测模块
|
||||
├── systemd_notifier.rb # systemd watchdog 心跳发送
|
||||
├── config.rb # 可调参数配置
|
||||
└── updates.rb # 更新检查模块
|
||||
|
||||
minesentinel.service # systemd 单元文件(项目源码中)
|
||||
```
|
||||
@@ -37,8 +38,8 @@ minesentinel.service # systemd 单元文件(项目源码中)
|
||||
### 1. 创建目录并复制文件
|
||||
|
||||
```bash
|
||||
mkdir -p /opt/minecraft/sentinel
|
||||
cp main.rb method_executor.rb server_status_detector.rb systemd_notifier.rb config.rb updates.rb /opt/minecraft/sentinel/
|
||||
mkdir -p /opt/minecraft/sentinel/src
|
||||
cp src/main.rb src/method_executor.rb src/server_status_detector.rb src/systemd_notifier.rb src/config.rb src/updates.rb /opt/minecraft/sentinel/src/
|
||||
```
|
||||
|
||||
### 2. 确认 Minecraft systemd 服务存在
|
||||
@@ -52,7 +53,7 @@ systemctl status minecraft
|
||||
### 3. 手动测试
|
||||
|
||||
```bash
|
||||
cd /opt/minecraft/sentinel
|
||||
cd /opt/minecraft/sentinel/src
|
||||
ruby main.rb
|
||||
# 调试模式:LOG_LEVEL=debug ruby main.rb
|
||||
```
|
||||
@@ -62,7 +63,7 @@ ruby main.rb
|
||||
项目源码中已提供 `minesentinel.service`,直接复制:
|
||||
|
||||
```bash
|
||||
cp minesentinel.service /etc/systemd/system/
|
||||
cp src/minesentinel.service /etc/systemd/system/
|
||||
```
|
||||
|
||||
单元文件内容(`minesentinel.service`):
|
||||
@@ -76,8 +77,8 @@ Wants=minecraft.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/minecraft/sentinel
|
||||
ExecStart=/usr/bin/ruby /opt/minecraft/sentinel/main.rb
|
||||
WorkingDirectory=/opt/minecraft/sentinel/src
|
||||
ExecStart=/usr/bin/ruby /opt/minecraft/sentinel/src/main.rb
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
@@ -13,8 +13,8 @@ Wants=minecraft.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/minecraft/sentinel
|
||||
ExecStart=/usr/bin/ruby /opt/minecraft/sentinel/main.rb
|
||||
WorkingDirectory=/opt/minecraft/sentinel/src
|
||||
ExecStart=/usr/bin/ruby /opt/minecraft/sentinel/src/main.rb
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
@@ -22,7 +22,7 @@ RELEASE_SERIAL_CODE = '60176fa'
|
||||
# @type const CHANNEL: String
|
||||
CHANNEL = 'master'
|
||||
# @type const VERSION_LIST_URL: String
|
||||
VERSION_LIST_URL = "https://raw.giteeusercontent.com/scu_team/minesentinel/#{CHANNEL}/APP_VERSIONS_LIST"
|
||||
VERSION_LIST_URL = "https://raw.giteeusercontent.com/SCU_team/mine-sentinel/#{CHANNEL}/APP_VERSIONS_LIST"
|
||||
# @type const RECURSIVE_RETRY_DEPTH: Integer
|
||||
RECURSIVE_RETRY_DEPTH = 3
|
||||
|
||||
@@ -3,7 +3,7 @@ name = "MineSentinel"
|
||||
description = "Minecraft 服务器智能守护进程,TCP 端口检测 + 崩溃自动重启 + 防循环冷却期"
|
||||
repo_url = "https://gitee.com/snoware/minesentinel"
|
||||
demo_url = "https://swe-iss.rth1.xyz/softwares/minesentinel"
|
||||
doc_url = "https://gitee.com/snoware/minesentinel/blob/master/DEPLOY.md"
|
||||
doc_url = "https://gitee.com/snoware/minesentinel/blob/master/docs/DEPLOY.md"
|
||||
tags = ["Ruby", "Minecraft", "Server", "Monitoring", "Daemon", "SNOWARE"]
|
||||
|
||||
[[projects]]
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Reference in New Issue
Block a user