From c5a19652c80162e670d29a7bd8c910d0acdfacb9 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Wed, 1 Jul 2015 14:47:48 +0530 Subject: glusterd: initialize the daemon services on demand Backport of http://review.gluster.org/#/c/11488/ As of now all the daemon services are initialized at glusterD init path. Since socket file path of per node daemon demands the uuid of the node, MY_UUID macro is invoked as part of the initialization. The above flow breaks the usecases where a gluster image is built following a template could be Dockerfile, Vagrantfile or any kind of virtualization environment. This means bringing instances of this image would have same UUIDs for the node resulting in peer probe failure. Solution is to lazily initialize the services on demand. Change-Id: If7caa533026c83e98c7c7678bded67085d0bbc1e BUG: 1247012 Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/11488 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Gaurav Kumar Garg Reviewed-by: Kaushal M Reviewed-on: http://review.gluster.org/11766 --- xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c index 04096a4a116..130bc56d4ee 100644 --- a/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c +++ b/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c @@ -49,9 +49,6 @@ static int glusterd_svc_init_common (glusterd_svc_t *svc, char *svc_name, char *workdir, char *rundir, char *logdir, - glusterd_svc_manager_t manager, - glusterd_svc_start_t start, - glusterd_svc_stop_t stop, glusterd_conn_notify_t notify) { int ret = -1; @@ -74,10 +71,6 @@ glusterd_svc_init_common (glusterd_svc_t *svc, if (ret < 0) goto out; - svc->manager = manager; - svc->start = start; - svc->stop = stop; - if (!notify) notify = glusterd_svc_common_rpc_notify; @@ -126,10 +119,7 @@ svc_add_args (dict_t *cmdline, char *arg, data_t *value, void *data) return 0; } -int glusterd_svc_init (glusterd_svc_t *svc, char *svc_name, - glusterd_svc_manager_t manager, - glusterd_svc_start_t start, - glusterd_svc_stop_t stop) +int glusterd_svc_init (glusterd_svc_t *svc, char *svc_name) { int ret = -1; char rundir[PATH_MAX] = {0,}; @@ -145,8 +135,7 @@ int glusterd_svc_init (glusterd_svc_t *svc, char *svc_name, glusterd_svc_build_rundir (svc_name, priv->workdir, rundir, sizeof (rundir)); ret = glusterd_svc_init_common (svc, svc_name, priv->workdir, rundir, - DEFAULT_LOG_FILE_DIRECTORY, manager, - start, stop, NULL); + DEFAULT_LOG_FILE_DIRECTORY, NULL); return ret; } -- cgit