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