d1681e
From ed84bfec039d2f3d63902dfe3bade2fe6eb6c31e Mon Sep 17 00:00:00 2001
d1681e
From: Atin Mukherjee <amukherj@redhat.com>
d1681e
Date: Tue, 3 Apr 2018 21:28:37 +0530
d1681e
Subject: [PATCH 206/212] glusterd: honour localtime-logging for all the
d1681e
 daemons
d1681e
d1681e
>upstream patch : https://review.gluster.org/#/c/19814/
d1681e
d1681e
>Change-Id: I97a70d29365b0a454241ac5f5cae56d93eefd73a
d1681e
>Fixes: bz#1563334
d1681e
>Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
d1681e
d1681e
Change-Id: I97a70d29365b0a454241ac5f5cae56d93eefd73a
d1681e
BUG: 958062
d1681e
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
d1681e
Reviewed-on: https://code.engineering.redhat.com/gerrit/134447
d1681e
Tested-by: RHGS Build Bot <nigelb@redhat.com>
d1681e
---
d1681e
 xlators/mgmt/glusterd/src/glusterd-rebalance.c | 6 ++++++
d1681e
 xlators/mgmt/glusterd/src/glusterd-snapd-svc.c | 6 ++++++
d1681e
 xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c  | 6 ++++++
d1681e
 xlators/mgmt/glusterd/src/glusterd-tierd-svc.c | 6 ++++++
d1681e
 4 files changed, 24 insertions(+)
d1681e
d1681e
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
d1681e
index 76191c4..848e689 100644
d1681e
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
d1681e
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
d1681e
@@ -196,6 +196,7 @@ glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr,
d1681e
         char                   volname[PATH_MAX] = {0,};
d1681e
         char                   valgrind_logfile[PATH_MAX] = {0,};
d1681e
         char                   *volfileserver = NULL;
d1681e
+        char                   *localtime_logging = NULL;
d1681e
 
d1681e
         this    = THIS;
d1681e
         GF_VALIDATE_OR_GOTO ("glusterd", this, out);
d1681e
@@ -312,6 +313,11 @@ glusterd_handle_defrag_start (glusterd_volinfo_t *volinfo, char *op_errstr,
d1681e
         runner_argprintf (&runner, logfile);
d1681e
         if (volinfo->memory_accounting)
d1681e
                 runner_add_arg (&runner, "--mem-accounting");
d1681e
+        if (dict_get_str (priv->opts, GLUSTERD_LOCALTIME_LOGGING_KEY,
d1681e
+                          &localtime_logging) == 0) {
d1681e
+                if (strcmp (localtime_logging, "enable") == 0)
d1681e
+                        runner_add_arg (&runner, "--localtime-logging");
d1681e
+        }
d1681e
 
d1681e
         ret = runner_run_nowait (&runner);
d1681e
         if (ret) {
d1681e
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c b/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c
d1681e
index 5621852..bd1c02e 100644
d1681e
--- a/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c
d1681e
+++ b/xlators/mgmt/glusterd/src/glusterd-snapd-svc.c
d1681e
@@ -226,6 +226,7 @@ glusterd_snapdsvc_start (glusterd_svc_t *svc, int flags)
d1681e
         char                 snapd_id[PATH_MAX]         = {0,};
d1681e
         glusterd_volinfo_t  *volinfo                    = NULL;
d1681e
         glusterd_snapdsvc_t *snapd                      = NULL;
d1681e
+        char                *localtime_logging          = NULL;
d1681e
 
d1681e
         this = THIS;
d1681e
         GF_ASSERT(this);
d1681e
@@ -298,6 +299,11 @@ glusterd_snapdsvc_start (glusterd_svc_t *svc, int flags)
d1681e
                          "-l", svc->proc.logfile,
d1681e
                          "--brick-name", snapd_id,
d1681e
                          "-S", svc->conn.sockpath, NULL);
d1681e
+        if (dict_get_str (priv->opts, GLUSTERD_LOCALTIME_LOGGING_KEY,
d1681e
+                          &localtime_logging) == 0) {
d1681e
+                if (strcmp (localtime_logging, "enable") == 0)
d1681e
+                        runner_add_arg (&runner, "--localtime-logging");
d1681e
+        }
d1681e
 
d1681e
         snapd_port = pmap_assign_port (THIS, volinfo->snapd.port, snapd_id);
d1681e
         if (!snapd_port) {
d1681e
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c
d1681e
index f229865..ba948b4 100644
d1681e
--- a/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c
d1681e
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-mgmt.c
d1681e
@@ -150,6 +150,7 @@ glusterd_svc_start (glusterd_svc_t *svc, int flags, dict_t *cmdline)
d1681e
         glusterd_conf_t     *priv                       = NULL;
d1681e
         xlator_t            *this                       = NULL;
d1681e
         char                 valgrind_logfile[PATH_MAX] = {0};
d1681e
+        char                *localtime_logging          = NULL;
d1681e
 
d1681e
         this = THIS;
d1681e
         GF_ASSERT (this);
d1681e
@@ -190,6 +191,11 @@ glusterd_svc_start (glusterd_svc_t *svc, int flags, dict_t *cmdline)
d1681e
                          "-S", svc->conn.sockpath,
d1681e
                          NULL);
d1681e
 
d1681e
+        if (dict_get_str (priv->opts, GLUSTERD_LOCALTIME_LOGGING_KEY,
d1681e
+                          &localtime_logging) == 0) {
d1681e
+                if (strcmp (localtime_logging, "enable") == 0)
d1681e
+                        runner_add_arg (&runner, "--localtime-logging");
d1681e
+        }
d1681e
         if (cmdline)
d1681e
                 dict_foreach (cmdline, svc_add_args, (void *) &runner);
d1681e
 
d1681e
diff --git a/xlators/mgmt/glusterd/src/glusterd-tierd-svc.c b/xlators/mgmt/glusterd/src/glusterd-tierd-svc.c
d1681e
index a2876ae..2c556fc 100644
d1681e
--- a/xlators/mgmt/glusterd/src/glusterd-tierd-svc.c
d1681e
+++ b/xlators/mgmt/glusterd/src/glusterd-tierd-svc.c
d1681e
@@ -259,6 +259,7 @@ glusterd_tierdsvc_start (glusterd_svc_t *svc, int flags)
d1681e
         glusterd_volinfo_t  *volinfo                    = NULL;
d1681e
         glusterd_tierdsvc_t *tierd                      = NULL;
d1681e
         int                  cmd                        = GF_DEFRAG_CMD_START_TIER;
d1681e
+        char                *localtime_logging          = NULL;
d1681e
 
d1681e
         this = THIS;
d1681e
         GF_VALIDATE_OR_GOTO (THIS->name, this, out);
d1681e
@@ -353,6 +354,11 @@ glusterd_tierdsvc_start (glusterd_svc_t *svc, int flags)
d1681e
                           volinfo->rebal.commit_hash);
d1681e
         if (volinfo->memory_accounting)
d1681e
                 runner_add_arg (&runner, "--mem-accounting");
d1681e
+        if (dict_get_str (priv->opts, GLUSTERD_LOCALTIME_LOGGING_KEY,
d1681e
+                          &localtime_logging) == 0) {
d1681e
+                if (strcmp (localtime_logging, "enable") == 0)
d1681e
+                        runner_add_arg (&runner, "--localtime-logging");
d1681e
+        }
d1681e
 
d1681e
         snprintf (msg, sizeof (msg),
d1681e
                   "Starting the tierd service for volume %s", volinfo->volname);
d1681e
-- 
d1681e
1.8.3.1
d1681e