From 5d5c5df777f8d679342f163a2f5be1d4f8fbe4ad Mon Sep 17 00:00:00 2001 From: Snowflake Date: Mon, 8 Jun 2026 08:39:05 +0800 Subject: [PATCH] Version ROLLING 08-06-2026 roll2 --- main.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.rb b/main.rb index 1a904f8..cf87c36 100644 --- a/main.rb +++ b/main.rb @@ -27,11 +27,20 @@ puts ' |\/| | |\ | |__ /__` |__ |\ | | | |\ | |__ | ' puts ' | | | | \| |___ .__/ |___ | \| | | | \| |___ |___ ' puts " MineSentinel dev-rolling version by <*> S.A. [@Snoware] and owned by SCU team." puts " This program is licensed under Mulan PubL v2." -puts " E-mail the author for more information: SALflake@qq.com or visit https://https://swe-iss.rth1.xyz/softwares/minesentinel." +puts " E-mail the author for more information: SALflake@qq.com or visit https://https://swe-iss.rth1.xyz/softwares/minesentinel.\n" require_relative 'method_executor' # 日志系统在此时初始化 +MethodExecutor.record("debug", "init", "Initialized MethodExecutor, which implements logging system and intervening functions.") require_relative 'server_status_detector' require_relative 'systemd_notifier' # 心跳系统在此时初始化 +MethodExecutor.record("debug", "init", "Initialized SystemdNotifier, which implements systemd watchdog feeder.") + +# 确认是否具有展开干预操作的权限 如果因场景不同不需要请注释这部分内容 +unless Process.euid == 0 + MethodExecutor.record("error", "init", "Permission denied: root required to intervene Systemd Services.") + raise Errno::EPERM +end + MethodExecutor.record("info", "mainloop", "MineSentinel started, entering mainloop.")