Compare commits

..

3 Commits

Author SHA1 Message Date
sa 8b59ef2038 Version ROLLING 08-06-2026 release1 2026-06-08 08:28:33 +08:00
sa 4d8500d97d Add welcome info. 2026-06-08 08:26:28 +08:00
sa 57a157bad7 Fixing socket type bug. 2026-06-08 08:10:18 +08:00
3 changed files with 12 additions and 2 deletions
File diff suppressed because one or more lines are too long
+7
View File
@@ -22,6 +22,13 @@ rescue => e
exit 1 exit 1
end end
puts ' ___ __ ___ ___ ___ '
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."
require_relative 'method_executor' # 日志系统在此时初始化 require_relative 'method_executor' # 日志系统在此时初始化
require_relative 'server_status_detector' require_relative 'server_status_detector'
require_relative 'systemd_notifier' # 心跳系统在此时初始化 require_relative 'systemd_notifier' # 心跳系统在此时初始化
+5 -1
View File
@@ -27,7 +27,11 @@ class SystemdNotifier
else else
MethodExecutor.record("debug", "heartbeat", "Found NOTIFY_SOCKET, enabling heartbeat") MethodExecutor.record("debug", "heartbeat", "Found NOTIFY_SOCKET, enabling heartbeat")
@enable_heartbeat = true @enable_heartbeat = true
@socket = UNIXSocket.new(@notify_socket) # Fix(2026-06-08): 将 UNIXSocket(SOCK_STREAM) 改为 SOCK_DGRAM
# systemd NOTIFY_SOCKET 是 datagram socket,用 stream socket 连接会报
# Protocol wrong type for socket (Errno::EPROTOTYPE)
@socket = Socket.new(Socket::AF_UNIX, Socket::SOCK_DGRAM)
@socket.connect(Socket.pack_sockaddr_un(@notify_socket))
MethodExecutor.record("debug", "heartbeat", "Heartbeat socket opened") MethodExecutor.record("debug", "heartbeat", "Heartbeat socket opened")
end end