Blob Blame History Raw
From d05d7a6fcba51747ac2c08216ed0e86f4db0aee0 Mon Sep 17 00:00:00 2001
From: Milind Changire <mchangir@redhat.com>
Date: Tue, 10 Oct 2017 09:58:24 +0530
Subject: [PATCH 624/624] build: launch glusterd upgrade after all new bits are
 installed

Problem:
glusterd upgrade mode needs new bits from glusterfs-rdma which
optional and causes the dependency graph to break since it is
not tied into glusterfs-server requirements

Solution:
Run glusterd upgrade mode after all new bits are installed
i.e. in %posttrans server section

Label: DOWNSTREAM ONLY

Change-Id: I356e02d0bf0eaaef43c20ce07b388262f63093a4
BUG: 1499251
Signed-off-by: Milind Changire <mchangir@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/120094
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: RHGS Build Bot <nigelb@redhat.com>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
---
 glusterfs.spec.in | 53 ++++++++++++++++++++++++++++++++---------------------
 1 file changed, 32 insertions(+), 21 deletions(-)

diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index 3e816ae..55747b7 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -919,27 +919,6 @@ if $(systemctl is-active firewalld 1>/dev/null 2>&1); then
 fi
 %endif
 
-pidof -c -o %PPID -x glusterd &> /dev/null
-if [ $? -eq 0 ]; then
-    kill -9 `pgrep -f gsyncd.py` &> /dev/null
-
-    killall --wait glusterd &> /dev/null
-    glusterd --xlator-option *.upgrade=on -N
-
-    #Cleaning leftover glusterd socket file which is created by glusterd in
-    #rpm_script_t context.
-    rm -rf /var/run/glusterd.socket
-
-    # glusterd _was_ running, we killed it, it exited after *.upgrade=on,
-    # so start it again
-    %_init_start glusterd
-else
-    glusterd --xlator-option *.upgrade=on -N
-
-    #Cleaning leftover glusterd socket file which is created by glusterd in
-    #rpm_script_t context.
-    rm -rf /var/run/glusterd.socket
-fi
 %endif
 
 ##-----------------------------------------------------------------------------
@@ -2099,9 +2078,41 @@ os.remove(tmpname)
 if not (ok == 0) then
    error("Detected running glusterfs processes", ok)
 end
+
+%posttrans server
+pidof -c -o %PPID -x glusterd &> /dev/null
+if [ $? -eq 0 ]; then
+    kill -9 `pgrep -f gsyncd.py` &> /dev/null
+
+    killall --wait -SIGTERM glusterd &> /dev/null
+
+    if [ "$?" != "0" ]; then
+        echo "killall failed while killing glusterd"
+    fi
+
+    glusterd --xlator-option *.upgrade=on -N
+
+    #Cleaning leftover glusterd socket file which is created by glusterd in
+    #rpm_script_t context.
+    rm -rf /var/run/glusterd.socket
+
+    # glusterd _was_ running, we killed it, it exited after *.upgrade=on,
+    # so start it again
+    %_init_start glusterd
+else
+    glusterd --xlator-option *.upgrade=on -N
+
+    #Cleaning leftover glusterd socket file which is created by glusterd in
+    #rpm_script_t context.
+    rm -rf /var/run/glusterd.socket
+fi
+
 %endif
 
 %changelog
+* Tue Oct 10 2017 Milind Changire <mchangir@redhat.com>
+- DOWNSTREAM ONLY patch - launch glusterd in upgrade mode after all new bits have been installed
+
 * Fri Aug 04 2017 Kaleb S. KEITHLEY <kkeithle@rehat.com>
 - /var/lib/glusterd/options made config(noreplace) to avoid losing shared state info
 
-- 
1.8.3.1