diff options
-rw-r--r-- | xlators/features/snapview-server/src/snapview-server-helpers.c | 4 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 16 |
2 files changed, 14 insertions, 6 deletions
diff --git a/xlators/features/snapview-server/src/snapview-server-helpers.c b/xlators/features/snapview-server/src/snapview-server-helpers.c index 46e7d49a036..fdabc00a9b5 100644 --- a/xlators/features/snapview-server/src/snapview-server-helpers.c +++ b/xlators/features/snapview-server/src/snapview-server-helpers.c @@ -477,8 +477,8 @@ __svs_initialise_snapshot_volume (xlator_t *this, const char *name) } snprintf (logfile, sizeof (logfile), - DEFAULT_SVD_LOG_FILE_DIRECTORY "/%s-%s.log", - name, dirent->uuid); + DEFAULT_SVD_LOG_FILE_DIRECTORY "/snaps/%s/%s-%s.log", + priv->volname, name, dirent->uuid); ret = glfs_set_logging(fs, logfile, loglevel); if (ret) { diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index a455cc03a30..678405de241 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -13301,6 +13301,7 @@ glusterd_snapd_start (glusterd_volinfo_t *volinfo, gf_boolean_t wait) runner_t runner = {0,}; char pidfile[PATH_MAX] = {0,}; char logfile[PATH_MAX] = {0,}; + char logdir[PATH_MAX] = {0,}; char volfile[PATH_MAX] = {0,}; char glusterd_uuid [1024] = {0,}; char rundir[PATH_MAX] = {0,}; @@ -13342,8 +13343,16 @@ glusterd_snapd_start (glusterd_volinfo_t *volinfo, gf_boolean_t wait) goto out; } - snprintf (logfile, PATH_MAX, "%s/%s-snapd.log", + snprintf (logdir, PATH_MAX, "%s/snaps/%s", DEFAULT_LOG_FILE_DIRECTORY, volname); + ret = mkdir_p (logdir, 0755, _gf_true); + if ((ret == -1) && (EEXIST != errno)) { + gf_log (this->name, GF_LOG_ERROR, "Unable to create logdir %s", + logdir); + goto out; + } + + snprintf (logfile, PATH_MAX, "%s/snapd.log", logdir); snprintf (volfileid, sizeof (volfileid), "snapd/%s", volname); glusterd_set_snapd_socket_filepath (volinfo, sockfpath, @@ -13357,9 +13366,8 @@ glusterd_snapd_start (glusterd_volinfo_t *volinfo, gf_boolean_t wait) runinit (&runner); if (priv->valgrind) { - snprintf (valgrind_logfile, PATH_MAX, - "%s/valgrind-%s-snapd.log", - DEFAULT_LOG_FILE_DIRECTORY, volname); + snprintf (valgrind_logfile, PATH_MAX, "%s/valgrind-snapd.log", + logdir); runner_add_args (&runner, "valgrind", "--leak-check=full", "--trace-children=yes", "--track-origins=yes", |