diff options
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 3 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 9 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.c | 9 |
3 files changed, 17 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 0d17f5131e1..2c99a60e2ca 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -1912,7 +1912,8 @@ glusterd_handle_log_locate (rpcsvc_request_t *req) strcpy (tmp_str, brickinfo->logfile); rsp.path = dirname (tmp_str); } else { - snprintf (tmp_str, PATH_MAX, "%s/logs/", priv->workdir); + snprintf (tmp_str, PATH_MAX, "%s/logs/bricks/", + priv->workdir); rsp.path = tmp_str; } break; diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 845fcbbe9ad..ed4d7a32796 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -815,7 +815,7 @@ glusterd_volume_start_glusterfs (glusterd_volinfo_t *volinfo, brickinfo->hostname, exp_path); if (!brickinfo->logfile) { - snprintf (logfile, PATH_MAX, "%s/logs/%s.log", + snprintf (logfile, PATH_MAX, "%s/logs/bricks/%s.log", priv->workdir, exp_path); brickinfo->logfile = gf_strdup (logfile); } @@ -1567,6 +1567,7 @@ glusterd_nfs_server_start () xlator_t *this = NULL; glusterd_conf_t *priv = NULL; char pidfile[PATH_MAX] = {0,}; + char logfile[PATH_MAX] = {0,}; char *volfile = NULL; char path[PATH_MAX] = {0,}; char cmd_str[8192] = {0,}; @@ -1601,9 +1602,11 @@ glusterd_nfs_server_start () goto out; } + snprintf (logfile, PATH_MAX, "%s/logs/nfs.log", priv->workdir); + snprintf (cmd_str, 8192, - "%s/sbin/glusterfs -f %s -p %s", - GFS_PREFIX, volfile, pidfile); + "%s/sbin/glusterfs -f %s -p %s -l %s", + GFS_PREFIX, volfile, pidfile, logfile); ret = gf_system (cmd_str); out: diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index edc287318a7..da40c285cdd 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -316,6 +316,15 @@ init (xlator_t *this) exit (1); } + snprintf (voldir, PATH_MAX, "%s/logs/bricks", dirname); + ret = mkdir (voldir, 0777); + if ((-1 == ret) && (errno != EEXIST)) { + gf_log (this->name, GF_LOG_CRITICAL, + "Unable to create logs directory %s" + " ,errno = %d", voldir, errno); + exit (1); + } + snprintf (voldir, PATH_MAX, "%s/nfs", dirname); ret = mkdir (voldir, 0777); if ((-1 == ret) && (errno != EEXIST)) { |