summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2016-07-22 11:40:32 +0530
committerJeff Darcy <jdarcy@redhat.com>2016-07-27 15:07:23 -0700
commitec6925a379c7bee071df1638bc2751b266cee346 (patch)
tree4217b497c5a599395103ebdb5b46acc680bf9abe /xlators/mgmt/glusterd
parent4e1ad2c96ea692e49fb82ce533cdc26818277e8d (diff)
snapshot/snapd: Don't display pid when snapd is offline
We were previously reading the pidfile, and displaying the pid even if snapd daemon is not running. Now to fix it, we re-assign pid value to -1, if snapd is offline. Change-Id: I4baff8d489fe9380061c52aea006db90fa421cd7 BUG: 1358244 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/14981 Tested-by: Vijay Bellur <vbellur@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
index 1765df3d0ef..5a09254511b 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
@@ -2051,6 +2051,8 @@ glusterd_add_snapd_to_dict (glusterd_volinfo_t *volinfo,
glusterd_svc_build_snapd_pidfile (volinfo, pidfile, sizeof (pidfile));
brick_online = gf_is_service_running (pidfile, &pid);
+ if (brick_online == _gf_false)
+ pid = -1;
memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "%s.pid", base_key);