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