summaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2014-04-04 17:00:09 +0530
committerVijay Bellur <vbellur@redhat.com>2014-04-10 08:15:50 -0700
commitd4cc7595b5e21a92386e41f7ad7570ad9a728bd4 (patch)
treeaac33f873b87fc35dec1fddf5a4b27c85dfe63bb /extras
parentbf8c9b331b2fb55882204fa31ede3997165e6748 (diff)
rpms: Add quota upgrade scripts to rpms
Also replace /tmp/quota-config-backup with /var/tmp/glusterfs/quota-config-backup in doc and upgrade scripts. Change-Id: I289662300d32f75e2fc6e789037c3224054a38a5 BUG: 969461 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/7401 Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'extras')
-rw-r--r--extras/Makefile.am2
-rwxr-xr-xextras/post-upgrade-script-for-quota.sh6
-rwxr-xr-xextras/pre-upgrade-script-for-quota.sh7
3 files changed, 11 insertions, 4 deletions
diff --git a/extras/Makefile.am b/extras/Makefile.am
index 3d780a0..c2c1c41 100644
--- a/extras/Makefile.am
+++ b/extras/Makefile.am
@@ -9,6 +9,8 @@ conf_DATA = glusterfs-logrotate gluster-rsyslog-7.2.conf gluster-rsyslog-5.8.con
voldir = $(sysconfdir)/glusterfs
vol_DATA = glusterd.vol
+scriptsdir = $(datadir)/glusterfs/scripts
+scripts_DATA = post-upgrade-script-for-quota.sh pre-upgrade-script-for-quota.sh
EXTRA_DIST = specgen.scm MacOSX/Portfile glusterfs-mode.el glusterfs.vim \
migrate-unify-to-distribute.sh backend-xattr-sanitize.sh \
diff --git a/extras/post-upgrade-script-for-quota.sh b/extras/post-upgrade-script-for-quota.sh
index 3347031..13b65e8 100755
--- a/extras/post-upgrade-script-for-quota.sh
+++ b/extras/post-upgrade-script-for-quota.sh
@@ -10,6 +10,8 @@
VOL=$1;
+BACKUP_DIR=/var/tmp/glusterfs/quota-config-backup
+
function set_limits {
local var=$(gluster volume info $1 | grep 'features.quota'| cut -d" " -f2);
@@ -31,8 +33,8 @@ function set_limits {
gluster volume start $1 force
sleep 3;
- local path_array=( $(cat /tmp/quota-config-backup/vol_$1 | tail -n +3 | awk '{print $1}') )
- local limit_array=( $(cat /tmp/quota-config-backup/vol_$1 | tail -n +3 | awk '{print $2}') )
+ local path_array=( $(cat $BACKUP_DIR/vol_$1 | tail -n +3 | awk '{print $1}') )
+ local limit_array=( $(cat $BACKUP_DIR/vol_$1 | tail -n +3 | awk '{print $2}') )
local len=${#path_array[@]}
for ((j=0; j<$len; j++))
diff --git a/extras/pre-upgrade-script-for-quota.sh b/extras/pre-upgrade-script-for-quota.sh
index 522e412..ddb4f7f 100755
--- a/extras/pre-upgrade-script-for-quota.sh
+++ b/extras/pre-upgrade-script-for-quota.sh
@@ -5,12 +5,15 @@
#This script must be run prior to upgrading the cluster to 3.5, that too on
#only one of the nodes in the cluster.
-mkdir -p /tmp/quota-config-backup
+BACKUP_DIR=/var/tmp/glusterfs/quota-config-backup
+
+mkdir -p $BACKUP_DIR
+
for i in `gluster volume list`; do
var=$(gluster volume info $i | grep 'features.quota'| cut -d" " -f2);
if [ -z "$var" ] || [ "$var" == "off" ]; then
continue
else
- gluster volume quota $i list > /tmp/quota-config-backup/vol_$i;
+ gluster volume quota $i list > $BACKUP_DIR/vol_$i;
fi;
done