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