Blob Blame History Raw
From 65d86c24d06056c1019150e10e9e5feaba98e7f7 Mon Sep 17 00:00:00 2001
From: Soumya Koduri <skoduri@redhat.com>
Date: Thu, 19 Jan 2017 15:01:12 +0530
Subject: [PATCH 276/285] common-ha: All statd related files need to be owned
 by rpcuser

Statd service is started as rpcuser by default. Hence the
files/directories needed by it under '/var/lib/nfs' should be
owned by the same user.

Note: This change is not in mainline as the cluster-bits
are being moved to storehaug project -
http://review.gluster.org/#/c/16349/
http://review.gluster.org/#/c/16333/

This is backport of below upstream fix -
        http://review.gluster.org/16433

>Change-Id: I89fd06aa9700c5ce60026ac825da7c154d9f48fd
>BUG: 1414665
>Signed-off-by: Soumya Koduri <skoduri@redhat.com>
>Reviewed-on: http://review.gluster.org/16433
>Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
>Smoke: Gluster Build System <jenkins@build.gluster.org>
>Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>

BUG: 1414663
Change-Id: I97f9e884cda28d98e650dd3ce89a272d98a1151d
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/96058
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
 extras/ganesha/scripts/ganesha-ha.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
index 0388316..df9cf2e 100644
--- a/extras/ganesha/scripts/ganesha-ha.sh
+++ b/extras/ganesha/scripts/ganesha-ha.sh
@@ -769,9 +769,11 @@ setup_state_volume()
         fi
         if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd ]; then
             mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd
+            chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd
         fi
         if [ ! -e ${mnt}/nfs-ganesha/${dirname}/nfs/state ]; then
             touch ${mnt}/nfs-ganesha/${dirname}/nfs/state
+            chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/state
         fi
         if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/ganesha/v4recov ]; then
             mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/ganesha/v4recov
@@ -781,9 +783,11 @@ setup_state_volume()
         fi
         if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm ]; then
             mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm
+            chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm
         fi
         if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak ]; then
             mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak
+            chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak
         fi
         if [ ! -e ${mnt}/nfs-ganesha/${dirname}/nfs/statd/state ]; then
             touch ${mnt}/nfs-ganesha/${dirname}/nfs/statd/state
@@ -831,9 +835,11 @@ addnode_state_volume()
     fi
     if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd ]; then
         mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd
+        chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd
     fi
     if [ ! -e ${mnt}/nfs-ganesha/${dirname}/nfs/state ]; then
         touch ${mnt}/nfs-ganesha/${dirname}/nfs/state
+        chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/state
     fi
     if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/ganesha/v4recov ]; then
         mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/ganesha/v4recov
@@ -843,9 +849,11 @@ addnode_state_volume()
     fi
     if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm ]; then
         mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm
+        chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm
     fi
     if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak ]; then
         mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak
+        chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak
     fi
     if [ ! -e ${mnt}/nfs-ganesha/${dirname}/nfs/statd/state ]; then
         touch ${mnt}/nfs-ganesha/${dirname}/nfs/statd/state
-- 
2.9.3