e7a346
From ea80ad2022197bbc910a2a8426f968d3a657dab7 Mon Sep 17 00:00:00 2001
e7a346
From: Milind Changire <mchangir@redhat.com>
e7a346
Date: Thu, 30 Nov 2017 17:37:12 +0530
e7a346
Subject: [PATCH 128/128] build: remove pretrans script for ganesha
e7a346
e7a346
pretrans script for ganesha gets in the way of package installation.
e7a346
There's no hard requirement for gluster processes to be shut down
e7a346
for pacakge installation.
e7a346
e7a346
Label: DOWNSTREAM ONLY
e7a346
e7a346
BUG: 1410719
e7a346
Change-Id: I3611cfa8eacbd8caa5560909b55d7705d2fc8678
e7a346
Signed-off-by: Milind Changire <mchangir@redhat.com>
e7a346
Reviewed-on: https://code.engineering.redhat.com/gerrit/127783
e7a346
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e7a346
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
e7a346
---
e7a346
 glusterfs.spec.in | 45 +++------------------------------------------
e7a346
 1 file changed, 3 insertions(+), 42 deletions(-)
e7a346
e7a346
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
e7a346
index abebb28..a230b24 100644
e7a346
--- a/glusterfs.spec.in
e7a346
+++ b/glusterfs.spec.in
e7a346
@@ -1875,48 +1875,6 @@ end
e7a346
 
e7a346
 
e7a346
 
e7a346
-%pretrans ganesha -p <lua>
e7a346
-if not posix.access("/bin/bash", "x") then
e7a346
-    -- initial installation, no shell, no running glusterfsd
e7a346
-    return 0
e7a346
-end
e7a346
-
e7a346
--- TODO: move this completely to a lua script
e7a346
--- For now, we write a temporary bash script and execute that.
e7a346
-
e7a346
-script = [[#!/bin/sh
e7a346
-pidof -c -o %PPID -x glusterfsd &>/dev/null
e7a346
-
e7a346
-if [ $? -eq 0 ]; then
e7a346
-   pushd . > /dev/null 2>&1
e7a346
-   for volume in /var/lib/glusterd/vols/*; do cd $volume;
e7a346
-       vol_type=`grep '^type=' info | awk -F'=' '{print $2}'`
e7a346
-       volume_started=`grep '^status=' info | awk -F'=' '{print $2}'`
e7a346
-       if [ $vol_type -eq 0 ] && [ $volume_started -eq 1 ] ; then
e7a346
-          exit 1;
e7a346
-       fi
e7a346
-   done
e7a346
-
e7a346
-   popd > /dev/null 2>&1
e7a346
-   exit 1;
e7a346
-fi
e7a346
-]]
e7a346
-
e7a346
--- Since we run pretrans scripts only for RPMs built for a server build,
e7a346
--- we can now use os.tmpname() since it is available on RHEL6 and later
e7a346
--- platforms which are server platforms.
e7a346
-tmpname = os.tmpname()
e7a346
-tmpfile = io.open(tmpname, "w")
e7a346
-tmpfile:write(script)
e7a346
-tmpfile:close()
e7a346
-ok, how, val = os.execute("/bin/bash " .. tmpname)
e7a346
-os.remove(tmpname)
e7a346
-if not (ok == 0) then
e7a346
-   error("Detected running glusterfs processes", ok)
e7a346
-end
e7a346
-
e7a346
-
e7a346
-
e7a346
 %if ( 0%{!?_without_georeplication:1} )
e7a346
 %pretrans geo-replication -p <lua>
e7a346
 if not posix.access("/bin/bash", "x") then
e7a346
@@ -2183,6 +2141,9 @@ fi
e7a346
 %endif
e7a346
 
e7a346
 %changelog
e7a346
+* Wed Jan 17 2018 Milind Changire <mchangir@redhat.com>
e7a346
+- DOWNSTREAM ONLY - Removed pretrans script for glusterfs-ganesha - (#1410719)
e7a346
+
e7a346
 * Wed Jan 17 2018 Mohit Agrawal <moagrawa@redhat.com>
e7a346
 - Exclude control-cpu-load.sh and control-mem.sh for RHEL_7 client builds only (#1534530)
e7a346
 
e7a346
-- 
e7a346
1.8.3.1
e7a346