Use of CTDB_SOCKET is being generally removed. However, this override
is being added to allow test code outside of ctdb/ to be able to
specify the socket, if desired.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
char *path_socket(TALLOC_CTX *mem_ctx, const char *daemon)
{
+ if (strcmp(daemon, "ctdbd") == 0) {
+ const char *t = getenv("CTDB_SOCKET");
+
+ if (t != NULL) {
+ return talloc_strdup(mem_ctx, t);
+ }
+ }
+
return talloc_asprintf(mem_ctx,
"%s/%s.socket",
path_rundir(),