|
|
cb8e9e |
From a701c96f94fb1c868566f7b3ad54b9e67b9ed211 Mon Sep 17 00:00:00 2001
|
|
|
cb8e9e |
From: Bala.FA <barumuga@redhat.com>
|
|
|
cb8e9e |
Date: Wed, 17 Jun 2015 21:34:52 +0530
|
|
|
cb8e9e |
Subject: [PATCH 098/101] build: add pretrans check
|
|
|
cb8e9e |
|
|
|
cb8e9e |
This patch adds pretrans check for client-xlators, ganesha and
|
|
|
cb8e9e |
python-gluster sub-packages.
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Label: DOWNSTREAM ONLY
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Bug: 1232641
|
|
|
cb8e9e |
Change-Id: I454016319832c11902c0ca79a79fbbcf8ac0a121
|
|
|
cb8e9e |
Signed-off-by: Bala.FA <barumuga@redhat.com>
|
|
|
cb8e9e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/50967
|
|
|
cb8e9e |
---
|
|
|
cb8e9e |
glusterfs.spec.in | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
cb8e9e |
1 files changed, 127 insertions(+), 0 deletions(-)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
|
|
cb8e9e |
index 388c28c..e4d9d5f 100644
|
|
|
cb8e9e |
--- a/glusterfs.spec.in
|
|
|
cb8e9e |
+++ b/glusterfs.spec.in
|
|
|
cb8e9e |
@@ -1512,6 +1512,47 @@ end
|
|
|
cb8e9e |
|
|
|
cb8e9e |
|
|
|
cb8e9e |
|
|
|
cb8e9e |
+%pretrans client-xlators -p <lua>
|
|
|
cb8e9e |
+if not posix.access("/bin/bash", "x") then
|
|
|
cb8e9e |
+ -- initial installation, no shell, no running glusterfsd
|
|
|
cb8e9e |
+ return 0
|
|
|
cb8e9e |
+end
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+-- TODO: move this completely to a lua script
|
|
|
cb8e9e |
+-- For now, we write a temporary bash script and execute that.
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+script = [[#!/bin/sh
|
|
|
cb8e9e |
+pidof -c -o %PPID -x glusterfsd &>/dev/null
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+if [ $? -eq 0 ]; then
|
|
|
cb8e9e |
+ pushd . > /dev/null 2>&1
|
|
|
cb8e9e |
+ for volume in /var/lib/glusterd/vols/*; do cd $volume;
|
|
|
cb8e9e |
+ vol_type=`grep '^type=' info | awk -F'=' '{print $2}'`
|
|
|
cb8e9e |
+ volume_started=`grep '^status=' info | awk -F'=' '{print $2}'`
|
|
|
cb8e9e |
+ if [ $vol_type -eq 0 ] && [ $volume_started -eq 1 ] ; then
|
|
|
cb8e9e |
+ exit 1;
|
|
|
cb8e9e |
+ fi
|
|
|
cb8e9e |
+ done
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+ popd > /dev/null 2>&1
|
|
|
cb8e9e |
+ exit 1;
|
|
|
cb8e9e |
+fi
|
|
|
cb8e9e |
+]]
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+-- rpm in RHEL5 does not have os.tmpname()
|
|
|
cb8e9e |
+-- io.tmpfile() can not be resolved to a filename to pass to bash :-/
|
|
|
cb8e9e |
+tmpname = "/tmp/glusterfs-client-xlators_pretrans_" .. os.date("%s")
|
|
|
cb8e9e |
+tmpfile = io.open(tmpname, "w")
|
|
|
cb8e9e |
+tmpfile:write(script)
|
|
|
cb8e9e |
+tmpfile:close()
|
|
|
cb8e9e |
+ok, how, val = os.execute("/bin/bash " .. tmpname)
|
|
|
cb8e9e |
+os.remove(tmpname)
|
|
|
cb8e9e |
+if not (ok == 0) then
|
|
|
cb8e9e |
+ error("Detected running glusterfs processes", ok)
|
|
|
cb8e9e |
+end
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
%pretrans devel -p <lua>
|
|
|
cb8e9e |
if not posix.access("/bin/bash", "x") then
|
|
|
cb8e9e |
-- initial installation, no shell, no running glusterfsd
|
|
|
cb8e9e |
@@ -1594,6 +1635,47 @@ end
|
|
|
cb8e9e |
|
|
|
cb8e9e |
|
|
|
cb8e9e |
|
|
|
cb8e9e |
+%pretrans ganesha -p <lua>
|
|
|
cb8e9e |
+if not posix.access("/bin/bash", "x") then
|
|
|
cb8e9e |
+ -- initial installation, no shell, no running glusterfsd
|
|
|
cb8e9e |
+ return 0
|
|
|
cb8e9e |
+end
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+-- TODO: move this completely to a lua script
|
|
|
cb8e9e |
+-- For now, we write a temporary bash script and execute that.
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+script = [[#!/bin/sh
|
|
|
cb8e9e |
+pidof -c -o %PPID -x glusterfsd &>/dev/null
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+if [ $? -eq 0 ]; then
|
|
|
cb8e9e |
+ pushd . > /dev/null 2>&1
|
|
|
cb8e9e |
+ for volume in /var/lib/glusterd/vols/*; do cd $volume;
|
|
|
cb8e9e |
+ vol_type=`grep '^type=' info | awk -F'=' '{print $2}'`
|
|
|
cb8e9e |
+ volume_started=`grep '^status=' info | awk -F'=' '{print $2}'`
|
|
|
cb8e9e |
+ if [ $vol_type -eq 0 ] && [ $volume_started -eq 1 ] ; then
|
|
|
cb8e9e |
+ exit 1;
|
|
|
cb8e9e |
+ fi
|
|
|
cb8e9e |
+ done
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+ popd > /dev/null 2>&1
|
|
|
cb8e9e |
+ exit 1;
|
|
|
cb8e9e |
+fi
|
|
|
cb8e9e |
+]]
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+-- rpm in RHEL5 does not have os.tmpname()
|
|
|
cb8e9e |
+-- io.tmpfile() can not be resolved to a filename to pass to bash :-/
|
|
|
cb8e9e |
+tmpname = "/tmp/glusterfs-ganesha_pretrans_" .. os.date("%s")
|
|
|
cb8e9e |
+tmpfile = io.open(tmpname, "w")
|
|
|
cb8e9e |
+tmpfile:write(script)
|
|
|
cb8e9e |
+tmpfile:close()
|
|
|
cb8e9e |
+ok, how, val = os.execute("/bin/bash " .. tmpname)
|
|
|
cb8e9e |
+os.remove(tmpname)
|
|
|
cb8e9e |
+if not (ok == 0) then
|
|
|
cb8e9e |
+ error("Detected running glusterfs processes", ok)
|
|
|
cb8e9e |
+end
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
%if ( 0%{!?_without_georeplication:1} )
|
|
|
cb8e9e |
%pretrans geo-replication -p <lua>
|
|
|
cb8e9e |
if not posix.access("/bin/bash", "x") then
|
|
|
cb8e9e |
@@ -1678,6 +1760,47 @@ end
|
|
|
cb8e9e |
|
|
|
cb8e9e |
|
|
|
cb8e9e |
|
|
|
cb8e9e |
+%pretrans -n python-gluster -p <lua>
|
|
|
cb8e9e |
+if not posix.access("/bin/bash", "x") then
|
|
|
cb8e9e |
+ -- initial installation, no shell, no running glusterfsd
|
|
|
cb8e9e |
+ return 0
|
|
|
cb8e9e |
+end
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+-- TODO: move this completely to a lua script
|
|
|
cb8e9e |
+-- For now, we write a temporary bash script and execute that.
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+script = [[#!/bin/sh
|
|
|
cb8e9e |
+pidof -c -o %PPID -x glusterfsd &>/dev/null
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+if [ $? -eq 0 ]; then
|
|
|
cb8e9e |
+ pushd . > /dev/null 2>&1
|
|
|
cb8e9e |
+ for volume in /var/lib/glusterd/vols/*; do cd $volume;
|
|
|
cb8e9e |
+ vol_type=`grep '^type=' info | awk -F'=' '{print $2}'`
|
|
|
cb8e9e |
+ volume_started=`grep '^status=' info | awk -F'=' '{print $2}'`
|
|
|
cb8e9e |
+ if [ $vol_type -eq 0 ] && [ $volume_started -eq 1 ] ; then
|
|
|
cb8e9e |
+ exit 1;
|
|
|
cb8e9e |
+ fi
|
|
|
cb8e9e |
+ done
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+ popd > /dev/null 2>&1
|
|
|
cb8e9e |
+ exit 1;
|
|
|
cb8e9e |
+fi
|
|
|
cb8e9e |
+]]
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+-- rpm in RHEL5 does not have os.tmpname()
|
|
|
cb8e9e |
+-- io.tmpfile() can not be resolved to a filename to pass to bash :-/
|
|
|
cb8e9e |
+tmpname = "/tmp/python-gluster_pretrans_" .. os.date("%s")
|
|
|
cb8e9e |
+tmpfile = io.open(tmpname, "w")
|
|
|
cb8e9e |
+tmpfile:write(script)
|
|
|
cb8e9e |
+tmpfile:close()
|
|
|
cb8e9e |
+ok, how, val = os.execute("/bin/bash " .. tmpname)
|
|
|
cb8e9e |
+os.remove(tmpname)
|
|
|
cb8e9e |
+if not (ok == 0) then
|
|
|
cb8e9e |
+ error("Detected running glusterfs processes", ok)
|
|
|
cb8e9e |
+end
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
%if ( 0%{!?_without_rdma:1} )
|
|
|
cb8e9e |
%pretrans rdma -p <lua>
|
|
|
cb8e9e |
if not posix.access("/bin/bash", "x") then
|
|
|
cb8e9e |
@@ -1805,6 +1928,10 @@ end
|
|
|
cb8e9e |
%endif
|
|
|
cb8e9e |
|
|
|
cb8e9e |
%changelog
|
|
|
cb8e9e |
+* Thu Jun 18 2015 Bala.FA <barumuga@redhat.com>
|
|
|
cb8e9e |
+- add pretrans check for client-xlators, ganesha and python-gluster
|
|
|
cb8e9e |
+ sub-packages (#1232641)
|
|
|
cb8e9e |
+
|
|
|
cb8e9e |
* Thu Jun 18 2015 Niels de Vos <ndevos@redhat.com>
|
|
|
cb8e9e |
- glusterfs-devel for client-builds should not depend on -server (#1227029)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
--
|
|
|
cb8e9e |
1.7.1
|
|
|
cb8e9e |
|