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