Fixing socket type bug.
This commit is contained in:
+5
-1
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user