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