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