summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2012-01-12 12:53:48 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-14 19:18:25 -0800
commit69dad8baff6b0461fde1edbcb1418d0ba3beaa6c (patch)
tree661084878d4e05491102726afdc5d5b363940e5a
parent1fbed11ead209a8bcd1fd65846e0dfac6d5e1f2d (diff)
mgmt/glusterd: changes to run nfs server and self-heal daemon with valgrind
Currently glusterd can start only the brick processes in the valgrind mode. This patch ensures that nfs server and self-heal daemon are also started with valgrind along with the bricks. Change-Id: I3136deb58d54075627cdd204002eb26fdfdde462 BUG: 773600 Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Reviewed-on: http://review.gluster.com/2638 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c42
1 files changed, 32 insertions, 10 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 3230ddc8ab0..a7125825072 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2506,12 +2506,16 @@ glusterd_nodesvc_start (char *server, gf_boolean_t pmap_signin)
int32_t ret = -1;
xlator_t *this = NULL;
glusterd_conf_t *priv = NULL;
+ runner_t runner = {0,};
char pidfile[PATH_MAX] = {0,};
char logfile[PATH_MAX] = {0,};
char volfile[PATH_MAX] = {0,};
char rundir[PATH_MAX] = {0,};
char shd_sockfpath[PATH_MAX] = {0,};
char volfileid[256] = {0};
+#ifdef DEBUG
+ char valgrind_logfile[PATH_MAX] = {0};
+#endif
this = THIS;
GF_ASSERT(this);
@@ -2550,22 +2554,40 @@ glusterd_nodesvc_start (char *server, gf_boolean_t pmap_signin)
sizeof (shd_sockfpath));
}
+ runinit (&runner);
//TODO: kp:change the assumption that shd is the one which signs in
// use runner_add_args?
- if (pmap_signin) {
- ret = runcmd (SBIN_DIR"/glusterfs", "-s", "localhost",
- "--volfile-id", volfileid,
- "-p", pidfile, "-l", logfile,
- "-S", shd_sockfpath, NULL);
- if (!ret)
- glusterd_shd_connect (shd_sockfpath);
+#ifdef DEBUG
+ if (priv->valgrind) {
+ snprintf (valgrind_logfile, PATH_MAX,
+ "%s/valgrnd-%s.log",
+ DEFAULT_LOG_FILE_DIRECTORY,
+ server);
+ runner_add_args (&runner, "valgrind", "--leak-check=full",
+ "--trace-children=yes", NULL);
+ runner_argprintf (&runner, "--log-file=%s", valgrind_logfile);
}
- else {
- ret = runcmd (SBIN_DIR"/glusterfs", "-f", volfile,
- "-p", pidfile, "-l", logfile, NULL);
+#endif
+
+ if (pmap_signin) {
+ runner_add_args (&runner, SBIN_DIR"/glusterfs", "-s",
+ "localhost", "--volfile-id", volfileid,
+ "-p", pidfile, "-l", logfile,
+ "-S", shd_sockfpath, NULL);
+ } else {
+ runner_add_args (&runner, SBIN_DIR"/glusterfs", "-f", volfile,
+ "-p", pidfile, "-l", logfile, NULL);
}
+ runner_log (&runner, "", GF_LOG_DEBUG, "Starting the nfs/glustershd "
+ "services");
+
+ ret = runner_run (&runner);
+ if (ret == 0) {
+ if (pmap_signin)
+ glusterd_shd_connect (shd_sockfpath);
+ }
out:
return ret;
}