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