ctdb-daemon: Drop attempt to connect to Unix domain socket
authorMartin Schwenke <martin@meltin.net>
Thu, 22 Sep 2016 04:47:02 +0000 (14:47 +1000)
committerStefan Metzmacher <metze@samba.org>
Thu, 13 Oct 2016 14:55:40 +0000 (16:55 +0200)
This was a weak attempt at exclusivity.  PID file creation now does
that properly.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12287

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 8eff9e96037627b1e4adf3ccc8da94ef8f0bad2a)

ctdb/server/ctdb_daemon.c

index 0202fc19b6ef258ba4e6ef6b232d9e56fb5c18a2..f01193a83ddcaee1b0222974f11cc13247695f61 100644 (file)
@@ -1007,15 +1007,6 @@ static int ux_socket_bind(struct ctdb_context *ctdb)
        addr.sun_family = AF_UNIX;
        strncpy(addr.sun_path, ctdb->daemon.name, sizeof(addr.sun_path)-1);
 
-       /* First check if an old ctdbd might be running */
-       if (connect(ctdb->daemon.sd,
-                   (struct sockaddr *)&addr, sizeof(addr)) == 0) {
-               DEBUG(DEBUG_CRIT,
-                     ("Something is already listening on ctdb socket '%s'\n",
-                      ctdb->daemon.name));
-               goto failed;
-       }
-
        /* Remove any old socket */
        unlink(ctdb->daemon.name);