summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.h
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2015-07-01 14:47:48 +0530
committerKaushal M <kaushal@redhat.com>2015-07-27 00:14:01 -0700
commitd49b4b1086119873664b77ea7d7f2a5dd8f671ee (patch)
treed29051a5daf4fff7e7debb6cf5ff2a737c0a993d /xlators/mgmt/glusterd/src/glusterd-svc-mgmt.h
parentfd296d90168002a475a9899a72a0dd1811f038ee (diff)
glusterd: initialize the daemon services on demand
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: 1238135 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/11488 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-svc-mgmt.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-svc-mgmt.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.h b/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.h
index 326d4dfb3c9..fe7a19385cd 100644
--- a/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.h
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.h
@@ -17,6 +17,8 @@
struct glusterd_svc_;
typedef struct glusterd_svc_ glusterd_svc_t;
+typedef void (*glusterd_svc_build_t) (glusterd_svc_t *svc);
+
typedef int (*glusterd_svc_manager_t) (glusterd_svc_t *svc,
void *data, int flags);
typedef int (*glusterd_svc_start_t) (glusterd_svc_t *svc, int flags);
@@ -26,20 +28,19 @@ struct glusterd_svc_ {
char name[PATH_MAX];
glusterd_conn_t conn;
glusterd_proc_t proc;
+ glusterd_svc_build_t build;
glusterd_svc_manager_t manager;
glusterd_svc_start_t start;
glusterd_svc_stop_t stop;
gf_boolean_t online;
+ gf_boolean_t inited;
};
int
glusterd_svc_create_rundir (char *rundir);
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);
+glusterd_svc_init (glusterd_svc_t *svc, char *svc_name);
int
glusterd_svc_start (glusterd_svc_t *svc, int flags, dict_t *cmdline);