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