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