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