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