From 7b95330bb594f1ccef55542416c127450ff7f89b Mon Sep 17 00:00:00 2001
From: Christoph Haag <christoph.haag@collabora.com>
Date: Wed, 21 Oct 2020 23:28:43 +0200
Subject: [PATCH] ipc: Print information to delete socket file

---
 src/xrt/ipc/server/ipc_server_mainloop_linux.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/xrt/ipc/server/ipc_server_mainloop_linux.c b/src/xrt/ipc/server/ipc_server_mainloop_linux.c
index d15f3dc8f..f74c05369 100644
--- a/src/xrt/ipc/server/ipc_server_mainloop_linux.c
+++ b/src/xrt/ipc/server/ipc_server_mainloop_linux.c
@@ -98,6 +98,10 @@ create_listen_socket(struct ipc_server_mainloop *ml, int *out_fd)
 		    "Or, is the systemd unit monado.socket or "
 		    "monado-dev.socket active?");
 #endif
+		if (errno == EADDRINUSE) {
+			U_LOG_E("If monado-service is not running, delete %s before starting a new instance",
+			        IPC_MSG_SOCK_FILE);
+		}
 		close(fd);
 		return ret;
 	}