From 5ce34add77fa3517a01e63b915c5f4e3241af470 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 18 Oct 2022 15:58:06 +0100 Subject: Do not attempt to connect to the socket as a client if systemd is active, from Julien Moutinho in GitHub issue 3345. --- client.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'client.c') diff --git a/client.c b/client.c index df6cee94..7f712ffb 100644 --- a/client.c +++ b/client.c @@ -284,6 +284,12 @@ client_main(struct event_base *base, int argc, char **argv, uint64_t flags, log_debug("flags are %#llx", (unsigned long long)client_flags); /* Initialize the client socket and start the server. */ +#ifdef HAVE_SYSTEMD + if (systemd_activated()) { + /* socket-based activation, do not even try to be a client. */ + fd = server_start(client_proc, flags, base, 0, NULL); + } else +#endif fd = client_connect(base, socket_path, client_flags); if (fd == -1) { if (errno == ECONNREFUSED) { -- cgit v1.2.3