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.")