···159159 //! Were we launched by socket activation, instead of explicitly?
160160 bool launched_by_socket;
161161162162+ //! The socket filename we bound to, if any.
163163+ char *socket_filename;
164164+162165 bool print_debug;
163166 bool print_spew;
164167
+9-1
src/xrt/ipc/ipc_server_process.c
···3636#include <fcntl.h>
3737#include <errno.h>
3838#include <stdio.h>
3939+#include <string.h>
39404041#ifdef XRT_HAVE_SYSTEMD
4142#include <systemd/sd-daemon.h>
···7576 // Close socket on exit
7677 close(s->listen_socket);
7778 s->listen_socket = -1;
7979+ if (!s->launched_by_socket && s->socket_filename) {
8080+ // Unlink it too, but only if we bound it.
8181+ unlink(s->socket_filename);
8282+ free(s->socket_filename);
8383+ s->socket_filename = NULL;
8484+ }
7885 }
7986}
8087···214221215222 addr.sun_family = AF_UNIX;
216223 strcpy(addr.sun_path, IPC_MSG_SOCK_FILE);
217217- unlink(IPC_MSG_SOCK_FILE);
218224219225 ret = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
220226 if (ret < 0) {
221227 close(fd);
222228 return ret;
223229 }
230230+ // Save for later
231231+ s->socket_filename = strdup(IPC_MSG_SOCK_FILE);
224232225233 ret = listen(fd, IPC_MAX_CLIENTS);
226234 if (ret < 0) {