233933
From 144f2eb56d1bbecc9c455065755f41ec81974e3e Mon Sep 17 00:00:00 2001
233933
From: Jiffin Tony Thottan <jthottan@redhat.com>
233933
Date: Sun, 7 Apr 2019 21:54:07 +0530
233933
Subject: [PATCH 087/124] ganesha : fixing minor issues after the backport from
233933
 3.4
233933
233933
label : DOWNSTREAM ONLY
233933
233933
Change-Id: Ib0f6d8728d2e33da63ed4baab0bb981a0b06a8e0
233933
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/167168
233933
Tested-by: RHGS Build Bot <nigelb@redhat.com>
233933
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
233933
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
233933
---
233933
 glusterfs.spec.in                            | 20 +++++++++++++++++---
233933
 xlators/mgmt/glusterd/src/glusterd-ganesha.c |  2 +-
233933
 2 files changed, 18 insertions(+), 4 deletions(-)
233933
233933
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
233933
index e0607ba..f6b823d 100644
233933
--- a/glusterfs.spec.in
233933
+++ b/glusterfs.spec.in
233933
@@ -883,6 +883,15 @@ sed -i 's|option working-directory /etc/glusterd|option working-directory %{_sha
233933
 install -D -p -m 0644 extras/glusterfs-logrotate \
233933
     %{buildroot}%{_sysconfdir}/logrotate.d/glusterfs
233933
 
233933
+# ganesha ghosts
233933
+%if ( 0%{!?_without_server:1} )
233933
+mkdir -p %{buildroot}%{_sysconfdir}/ganesha
233933
+touch %{buildroot}%{_sysconfdir}/ganesha/ganesha-ha.conf
233933
+mkdir -p %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/
233933
+touch %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha.conf
233933
+touch %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha-ha.conf
233933
+%endif
233933
+
233933
 %if ( 0%{!?_without_georeplication:1} )
233933
 mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/geo-replication
233933
 touch %{buildroot}%{_sharedstatedir}/glusterd/geo-replication/gsyncd_template.conf
233933
@@ -1197,7 +1206,7 @@ exit 0
233933
 
233933
 %if ( 0%{?_without_server:1} )
233933
 #exclude ganesha related files
233933
-%exclude %{_sysconfdir}/ganesha/*
233933
+%exclude %{_sysconfdir}/ganesha/ganesha-ha.conf.sample
233933
 %exclude %{_libexecdir}/ganesha/*
233933
 %exclude %{_prefix}/lib/ocf/resource.d/heartbeat/*
233933
 %endif
233933
@@ -1376,9 +1385,15 @@ exit 0
233933
 
233933
 %if ( 0%{!?_without_server:1} )
233933
 %files ganesha
233933
-%{_sysconfdir}/ganesha/*
233933
+%dir %{_libexecdir}/ganesha
233933
+%{_sysconfdir}/ganesha/ganesha-ha.conf.sample
233933
 %{_libexecdir}/ganesha/*
233933
 %{_prefix}/lib/ocf/resource.d/heartbeat/*
233933
+%{_sharedstatedir}/glusterd/hooks/1/start/post/S31ganesha-start.sh
233933
+%ghost      %attr(0644,-,-) %config(noreplace) %{_sysconfdir}/ganesha/ganesha-ha.conf
233933
+%ghost %dir %attr(0755,-,-) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha
233933
+%ghost      %attr(0644,-,-) %config(noreplace) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha.conf
233933
+%ghost      %attr(0644,-,-) %config(noreplace) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha-ha.conf
233933
 %endif
233933
 
233933
 %if ( 0%{!?_without_ocf:1} )
233933
@@ -1508,7 +1523,6 @@ exit 0
233933
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post
233933
             %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post/S29CTDBsetup.sh
233933
             %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post/S30samba-start.sh
233933
-            %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post/S31ganesha-start.sh
233933
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/pre
233933
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop
233933
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/post
233933
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
233933
index d882105..0a16925 100644
233933
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
233933
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
233933
@@ -278,7 +278,7 @@ glusterd_op_stage_set_ganesha(dict_t *dict, char **op_errstr)
233933
         goto out;
233933
     }
233933
 
233933
-    if (strcmp(value, "enable")) {
233933
+    if (strcmp(value, "enable") == 0) {
233933
         ret = start_ganesha(op_errstr);
233933
         if (ret) {
233933
             gf_msg(THIS->name, GF_LOG_ERROR, 0, GD_MSG_NFS_GNS_START_FAIL,
233933
-- 
233933
1.8.3.1
233933