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