From c193996c94901d81a2a623799d83ef96f595d3e2 Mon Sep 17 00:00:00 2001 From: "Bala.FA" Date: Thu, 10 Apr 2014 14:03:55 +0530 Subject: build: set run levels for glusterd init script properly 'chkconfig --add glusterd' does not set run levels for start/stop. This patch fixes it. Change-Id: I8962f5207d034b6875353e15eb60c4d08c5a4fe4 BUG: 1086141 Signed-off-by: Bala.FA Reviewed-on: http://review.gluster.org/7432 Reviewed-by: Niels de Vos Tested-by: Gluster Build System --- extras/init.d/glusterd-Redhat.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'extras') diff --git a/extras/init.d/glusterd-Redhat.in b/extras/init.d/glusterd-Redhat.in index e320708ae..c6254a066 100755 --- a/extras/init.d/glusterd-Redhat.in +++ b/extras/init.d/glusterd-Redhat.in @@ -11,8 +11,8 @@ # Required-Stop: $local_fs $network # Should-Start: # Should-Stop: -# Default-Start: -# Default-Stop: 0 1 2 3 4 5 6 +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 # Short-Description: glusterfs server # Description: Clustered file-system server ### END INIT INFO -- cgit From f7e19ce46782fd62c50894ed541cebdcf72ead82 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 15 Apr 2014 11:24:31 +0200 Subject: scripts: add new email aliases Two developers started to use new email addresses, marking them as aliases. Also assign @gmail.com addresses to the "(unknown)" employer. Change-Id: Ic5722c1611b003182c0288ba530d6ab275c2ca1b BUG: 1087771 Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/7484 Reviewed-by: Prashanth Pai Reviewed-by: Vijay Bellur Tested-by: Vijay Bellur --- extras/who-wrote-glusterfs/gitdm.aliases | 2 ++ extras/who-wrote-glusterfs/gitdm.domain-map | 1 + 2 files changed, 3 insertions(+) (limited to 'extras') diff --git a/extras/who-wrote-glusterfs/gitdm.aliases b/extras/who-wrote-glusterfs/gitdm.aliases index 784a3e3bc..e19b99c79 100644 --- a/extras/who-wrote-glusterfs/gitdm.aliases +++ b/extras/who-wrote-glusterfs/gitdm.aliases @@ -20,6 +20,7 @@ harsha@gluster.com fharshav@redhat.com harsha@zresearch.com fharshav@redhat.com harsha@dev.gluster.com fharshav@redhat.com harsha@harshavardhana.net fharshav@redhat.com +jclift@redhat.com jclift@gluster.org kkeithle@f16node1.kkeithle.usersys.redhat.com kkeithle@redhat.com kaushal@gluster.com kaushal@redhat.com kaushikbv@gluster.com kbudiger@redhat.com @@ -29,6 +30,7 @@ krishna@guest-laptop ksriniva@redhat.com kp@gluster.com kparthas@redhat.com me@louiszuckerman.com louiszuckerman@gmail.com msvbhat@gmail.com vbhat@redhat.com +nullpai@gmail.com ppai@redhat.com vishwanath@gluster.com vbhat@redhat.com pavan@dev.gluster.com pavan@gluster.com zaitcev@yahoo.com zaitcev@kotori.zaitcev.us diff --git a/extras/who-wrote-glusterfs/gitdm.domain-map b/extras/who-wrote-glusterfs/gitdm.domain-map index f1c305898..39526f0f9 100644 --- a/extras/who-wrote-glusterfs/gitdm.domain-map +++ b/extras/who-wrote-glusterfs/gitdm.domain-map @@ -4,6 +4,7 @@ active.by ActiveCloud cern.ch CERN gluster.com Red Hat +gmail.com (unknown) gooddata.com GoodData hastexo.com hastexo ibm.com IBM -- cgit From 1dc3331d93ea9a2bb17a6dfa54f24ff57ecd6047 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 16 Apr 2014 12:05:14 -0700 Subject: scripts: Use `/bin/bash` not `/bin/sh` If using `/bin/sh` this is what we see $ ./who-wrote-glusterfs.sh ./who-wrote-glusterfs.sh: 39: shift: can't shift that many Use `/bin/bash` instead where 'shift' without an argument is supported. Change-Id: I2be05f0062eb8456631c1cee859757052f1b6dc7 BUG: 1087771 Signed-off-by: Harshavardhana Reviewed-on: http://review.gluster.org/7496 Reviewed-by: Niels de Vos Tested-by: Gluster Build System --- extras/who-wrote-glusterfs/who-wrote-glusterfs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extras') diff --git a/extras/who-wrote-glusterfs/who-wrote-glusterfs.sh b/extras/who-wrote-glusterfs/who-wrote-glusterfs.sh index 487f5874b..7a1896e6a 100755 --- a/extras/who-wrote-glusterfs/who-wrote-glusterfs.sh +++ b/extras/who-wrote-glusterfs/who-wrote-glusterfs.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Gather statistics on "Who wrote GlusterFS". The idea comes from the excellent # articles on http://lwn.net/ named "Who wrote ?". -- cgit From e55f3fe25a4fd2cc9021fad97faedc5e94aa4e7c Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Tue, 17 Sep 2013 17:01:07 +0530 Subject: Add upgrade scripts for quota Change-Id: I289662300d32f75e2fc6e789037c3224054a38a5 BUG: 969461 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/7418 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- extras/Makefile.am | 5 ++- extras/post-upgrade-script-for-quota.sh | 65 +++++++++++++++++++++++++++++++++ extras/pre-upgrade-script-for-quota.sh | 18 +++++++++ 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100755 extras/post-upgrade-script-for-quota.sh create mode 100755 extras/pre-upgrade-script-for-quota.sh (limited to 'extras') diff --git a/extras/Makefile.am b/extras/Makefile.am index faa91cddf..525fa9738 100644 --- a/extras/Makefile.am +++ b/extras/Makefile.am @@ -9,11 +9,14 @@ 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 = $(conf_DATA) specgen.scm MacOSX/Portfile glusterfs-mode.el \ glusterfs.vim migrate-unify-to-distribute.sh backend-xattr-sanitize.sh \ backend-cleanup.sh disk_usage_sync.sh clear_xattrs.sh \ - glusterd-sysconfig glusterd.vol + glusterd-sysconfig glusterd.vol post-upgrade-script-for-quota.sh \ + pre-upgrade-script-for-quota.sh install-data-local: $(mkdir_p) $(DESTDIR)$(localstatedir)/lib/glusterd/groups diff --git a/extras/post-upgrade-script-for-quota.sh b/extras/post-upgrade-script-for-quota.sh new file mode 100755 index 000000000..c22668793 --- /dev/null +++ b/extras/post-upgrade-script-for-quota.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +#The post-upgrade script must be executed after all the nodes in the cluster +#have upgraded. +#Also, all the clients accessing the given volume must also be upgraded +#before the script is run. +#Make sure glusterd and the brick processes are running on all nodes in the +#cluster post upgrade. +#Execute this script on the node where the pre-upgrade script for quota was run. + +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); + + if [ -z "$var" ] || [ "$var" == "off" ]; then + if [ $2 -eq '0' ]; then + echo "Volume $1 does not have quota enabled. " \ + "Exiting ..." + exit 1 + fi + else + gluster volume set $1 default-soft-limit 80% + if [ $? -ne '0' ]; then + echo "Post-upgrade process failed." \ + "Please address the error and run " \ + "post-upgrade-script.sh on volume $VOL again." + exit 1 + fi + + gluster volume start $1 force + sleep 3; + + 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++)) + do + gluster volume quota $1 limit-usage ${path_array[$j]} ${limit_array[j]}; + if [ $? -eq 0 ]; then + echo "Setting limit (${limit_array[j]}) on " \ + "path ${path_array[$j]} has been " \ + "successful" + fi + done + fi; +} + +if [ -z $1 ]; then + echo "Please provide volume name or 'all'"; + exit 1; +fi + +if [ "$1" == "all" ]; then + for VOL in `gluster volume list`; + do + set_limits $VOL '1'; + done + +else + set_limits $1 '0'; +fi diff --git a/extras/pre-upgrade-script-for-quota.sh b/extras/pre-upgrade-script-for-quota.sh new file mode 100755 index 000000000..a8001e9e1 --- /dev/null +++ b/extras/pre-upgrade-script-for-quota.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +#Make sure glusterd and the brick processes are running on all nodes in the +#cluster. +#This script must be run prior to upgradation, that too on +#only one of the nodes in the cluster. + +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 > $BACKUP_DIR/vol_$i; + fi; +done -- cgit