50dc83
From 8a3035bf612943694a3cd1c6a857bd009e84f55d Mon Sep 17 00:00:00 2001
e7a346
From: Milind Changire <mchangir@redhat.com>
e7a346
Date: Tue, 10 Oct 2017 09:58:24 +0530
50dc83
Subject: [PATCH 19/52] build: launch glusterd upgrade after all new bits are
e7a346
 installed
e7a346
e7a346
Problem:
e7a346
glusterd upgrade mode needs new bits from glusterfs-rdma which
e7a346
optional and causes the dependency graph to break since it is
e7a346
not tied into glusterfs-server requirements
e7a346
e7a346
Solution:
e7a346
Run glusterd upgrade mode after all new bits are installed
e7a346
i.e. in %posttrans server section
e7a346
e7a346
Label: DOWNSTREAM ONLY
e7a346
e7a346
Change-Id: I356e02d0bf0eaaef43c20ce07b388262f63093a4
e7a346
Signed-off-by: Milind Changire <mchangir@redhat.com>
e7a346
Reviewed-on: https://code.engineering.redhat.com/gerrit/120094
e7a346
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
e7a346
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e7a346
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
e7a346
---
50dc83
 glusterfs.spec.in | 51 +++++++++++++++++++++++++++++----------------------
50dc83
 1 file changed, 29 insertions(+), 22 deletions(-)
e7a346
e7a346
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
50dc83
index 3a98822..208a82d 100644
e7a346
--- a/glusterfs.spec.in
e7a346
+++ b/glusterfs.spec.in
50dc83
@@ -946,28 +946,6 @@ fi
e7a346
     %firewalld_reload
e7a346
 %endif
e7a346
 
e7a346
-pidof -c -o %PPID -x glusterd &> /dev/null
e7a346
-if [ $? -eq 0 ]; then
e7a346
-    kill -9 `pgrep -f gsyncd.py` &> /dev/null
e7a346
-
e7a346
-    killall --wait glusterd &> /dev/null
e7a346
-    glusterd --xlator-option *.upgrade=on -N
e7a346
-
e7a346
-    #Cleaning leftover glusterd socket file which is created by glusterd in
e7a346
-    #rpm_script_t context.
e7a346
-    rm -f %{_rundir}/glusterd.socket
e7a346
-
e7a346
-    # glusterd _was_ running, we killed it, it exited after *.upgrade=on,
e7a346
-    # so start it again
50dc83
-    %service_start glusterd
e7a346
-else
e7a346
-    glusterd --xlator-option *.upgrade=on -N
e7a346
-
e7a346
-    #Cleaning leftover glusterd socket file which is created by glusterd in
e7a346
-    #rpm_script_t context.
e7a346
-    rm -f %{_rundir}/glusterd.socket
e7a346
-fi
50dc83
-exit 0
e7a346
 %endif
e7a346
 
e7a346
 ##-----------------------------------------------------------------------------
50dc83
@@ -2027,6 +2005,35 @@ os.remove(tmpname)
e7a346
 if not (ok == 0) then
e7a346
    error("Detected running glusterfs processes", ok)
e7a346
 end
e7a346
+
e7a346
+%posttrans server
e7a346
+pidof -c -o %PPID -x glusterd &> /dev/null
e7a346
+if [ $? -eq 0 ]; then
e7a346
+    kill -9 `pgrep -f gsyncd.py` &> /dev/null
e7a346
+
e7a346
+    killall --wait -SIGTERM glusterd &> /dev/null
e7a346
+
e7a346
+    if [ "$?" != "0" ]; then
e7a346
+        echo "killall failed while killing glusterd"
e7a346
+    fi
e7a346
+
e7a346
+    glusterd --xlator-option *.upgrade=on -N
e7a346
+
e7a346
+    #Cleaning leftover glusterd socket file which is created by glusterd in
e7a346
+    #rpm_script_t context.
e7a346
+    rm -rf /var/run/glusterd.socket
e7a346
+
e7a346
+    # glusterd _was_ running, we killed it, it exited after *.upgrade=on,
e7a346
+    # so start it again
50dc83
+    %service_start glusterd
e7a346
+else
e7a346
+    glusterd --xlator-option *.upgrade=on -N
e7a346
+
e7a346
+    #Cleaning leftover glusterd socket file which is created by glusterd in
e7a346
+    #rpm_script_t context.
e7a346
+    rm -rf /var/run/glusterd.socket
e7a346
+fi
e7a346
+
e7a346
 %endif
e7a346
 
e7a346
 %changelog
e7a346
-- 
e7a346
1.8.3.1
e7a346