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