233933
From 71f4d55770287288f39b31a0435916ac3d9f742b Mon Sep 17 00:00:00 2001
233933
From: Sunil Kumar Acharya <sheggodu@redhat.com>
233933
Date: Fri, 5 Apr 2019 22:27:52 +0530
233933
Subject: [PATCH 51/52] spec: update rpm install condition
233933
233933
Update code to allow rpm install without gluster process shutdown.
233933
233933
Label: DOWNSTREAM ONLY
233933
233933
BUG: 1493284
233933
Change-Id: I308e7e4629a2428927a6df34536e3cd645a54f8c
233933
Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/167089
233933
Tested-by: RHGS Build Bot <nigelb@redhat.com>
233933
Reviewed-by: Milind Changire <mchangir@redhat.com>
233933
---
233933
 glusterfs.spec.in | 34 ----------------------------------
233933
 1 file changed, 34 deletions(-)
233933
233933
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
233933
index 7c7f7c0..0d57b49 100644
233933
--- a/glusterfs.spec.in
233933
+++ b/glusterfs.spec.in
233933
@@ -1629,40 +1629,6 @@ if not (ok == 0) then
233933
 end
233933
 
233933
 
233933
-%pretrans devel -p <lua>
233933
-if not posix.access("/bin/bash", "x") then
233933
-    -- initial installation, no shell, no running glusterfsd
233933
-    return 0
233933
-end
233933
-
233933
--- TODO: move this completely to a lua script
233933
--- For now, we write a temporary bash script and execute that.
233933
-
233933
-script = [[#!/bin/sh
233933
-pidof -c -o %PPID -x glusterfsd &>/dev/null
233933
-
233933
-if [ $? -eq 0 ]; then
233933
-   pushd . > /dev/null 2>&1
233933
-   for volume in /var/lib/glusterd/vols/*; do cd $volume;
233933
-       vol_type=`grep '^type=' info | awk -F'=' '{print $2}'`
233933
-       volume_started=`grep '^status=' info | awk -F'=' '{print $2}'`
233933
-       if [ $vol_type -eq 0 ] && [ $volume_started -eq 1 ] ; then
233933
-          exit 1;
233933
-       fi
233933
-   done
233933
-
233933
-   popd > /dev/null 2>&1
233933
-   exit 1;
233933
-fi
233933
-]]
233933
-
233933
-ok, how, val = os.execute(script)
233933
-if not (ok == 0) then
233933
-   error("Detected running glusterfs processes", ok)
233933
-end
233933
-
233933
-
233933
-
233933
 %pretrans fuse -p <lua>
233933
 if not posix.access("/bin/bash", "x") then
233933
     -- initial installation, no shell, no running glusterfsd
233933
-- 
233933
1.8.3.1
233933