From 733df5316f61591ab39265270a1ae1564afd7f67 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Mon, 26 Sep 2011 13:58:32 +0530 Subject: helper_scripts/install_parallel_glusterfs: script to install the glusterfs simultaneously on multiple machines This scripts looks into a file to know the IP address of the machines where glusterfs has to be installed. Then executes the download_and_install.sh script on all the machines. It is assumed that download_and_install.sh script is available on all the machines. glusterfs version is given as the argument. --- helper_scrips/INFO | 4 +- helper_scrips/install_parallel_glusterfs.sh | 64 +++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100755 helper_scrips/install_parallel_glusterfs.sh diff --git a/helper_scrips/INFO b/helper_scrips/INFO index 1f09a1b..c349fba 100644 --- a/helper_scrips/INFO +++ b/helper_scrips/INFO @@ -6,10 +6,12 @@ helper_scrips/rpm_qa_download_install.sh -----> downloads the rpms for the speci ============================================================================================================================================= -herper_scripts/clean_glusterd.sh +helper_scripts/clean_glusterd.sh helper_scripts/clean_logs.sh helper_scripts/start_glusterd.sh helper_scripts/probe.sh The above scripts are usable with the passwordless ssh connection setup between the glusterfs servers, which helps in cleaning the logs, probing, cleaning glusterd, starting glusterd etc. +============================================================================================================================================= +helper_scripts/install_parallel_glusterfs.sh --------> executes the download_and_install.sh scripts prallely on multiple machines, such that glusterfs gets installed on multiple machines simultaneously. diff --git a/helper_scrips/install_parallel_glusterfs.sh b/helper_scrips/install_parallel_glusterfs.sh new file mode 100755 index 0000000..15455fb --- /dev/null +++ b/helper_scrips/install_parallel_glusterfs.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +function _init () +{ + set -u; + VERSION=$1; +} + +function install_glusterfs () +{ + local remote_server=; + + if [ $# -eq 1 ]; then + remote_server=$1; + fi + + if [ $remote_server ]; then + ssh $remote_server cp -f /root/scripts/download_and_install.sh /root/; + ssh $remote_server /root/download_and_install.sh $VERSION; + return 0; + fi + + j=0; + for i in $(cat /root/machines) + do + j=$(($j+1)); + (install_glusterfs $i)& + done + +} + +function install_my_glusterfs () +{ + old_PWD=$PWD; + + cd /root; + cp /root/scripts/download_and_install.sh /root/; + /root/download_and_install.sh $VERSION; + + cd $old_PWD; + return 0; +} + +function main () +{ + stat --printf=%i /root/machines 2>/dev/null 1>/dev/null; + if [ $? -ne 0 ]; then + echo "servers file is not present /root. Cannot execute further."; + + exit 1; + fi + + install_glusterfs; + for i in $(1 $j) + do + wait %$j; + done + + install_my_glusterfs; + + return 0; +} + +_init "$@" && main "$@" -- cgit From ff2fa6cb4fc013f158fd0195a34b838d79c72894 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 29 Sep 2011 15:21:01 +0530 Subject: sanity/nightly_sanity/nightly_updated.sh: make changes for the copying the new statedump files Previously statedump files were located in /tmp/with the name glusterfs. Now (glusterfs-3.3.0qa12 onwards) its not like that. Brick statedumps are saved in the pattern "brick-path..dump" and client statedumps are saved in the pattern glusterdump..dump. Changes are done with this commit to make nightly sanity script aware of that. --- sanity/nightly_sanity/nightly_updated.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sanity/nightly_sanity/nightly_updated.sh b/sanity/nightly_sanity/nightly_updated.sh index baed7d3..a8f4da1 100755 --- a/sanity/nightly_sanity/nightly_updated.sh +++ b/sanity/nightly_sanity/nightly_updated.sh @@ -702,7 +702,7 @@ function take_statedump () BRICK_PID=$(cat /etc/glusterd/vols/vol/run/$i); kill -USR1 $BRICK_PID; sleep 1; - mv /tmp/glusterdump.$BRICK_PID $dir; + mv /tmp/*.$BRICK_PID.dump $dir; done for j in $(seq 1 $num_clients) @@ -710,10 +710,10 @@ function take_statedump () CLIENT_PID=$(cat /tmp/client_pid$j); kill -USR1 $CLIENT_PID; sleep 1; - mv /tmp/glusterdump.$CLIENT_PID $dir; + mv /tmp/*.$CLIENT_PID.dump $dir; done } - + function main() { echo "In main"; @@ -724,7 +724,7 @@ function main() start_glusterd; start_glusterfs; take_statedump $LOGDIR/old_dump/; - run_tests; + run_tests; take_statedump $LOGDIR/new_dump/; trap - INT TERM EXIT post_run; -- cgit From e419966d7276ab501059b15d040f6163280732c5 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 5 Oct 2011 19:03:03 +0530 Subject: c_pgms/truncte_write.c: program which creates a sparse file and writes at some offset This program creats a file if it does not exist (filename given as an argument), opens it truncates it to the size mentioned in the argument (default 5GB), then writes some data to some offset. Thus in general creates a sparse file and write into it. --- c_pgms/INFO | 2 + c_pgms/truncate_write.c | 156 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+) create mode 100644 c_pgms/truncate_write.c diff --git a/c_pgms/INFO b/c_pgms/INFO index b755c79..a73a6df 100644 --- a/c_pgms/INFO +++ b/c_pgms/INFO @@ -17,3 +17,5 @@ c_pgms/new-ps-perf(new-fs-perf.c) -----> fs-perf test program modified. Now the =============================================== c_pgms/ping_pong.c (ping_pong.c) -------> ping_pong program modified. Now the time duration for which ping_pong should execute can be given as an argument. By default it executed for 600 seconds. + +c_pgms/truncate_write.c (trucate_write.c) -----> it truncates a file to the size specified (default is 5GB, and creates and truncates if the file does not exist), writes some data to some offset. diff --git a/c_pgms/truncate_write.c b/c_pgms/truncate_write.c new file mode 100644 index 0000000..d6dcce9 --- /dev/null +++ b/c_pgms/truncate_write.c @@ -0,0 +1,156 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#define UNIT_KB 1024ULL +#define UNIT_MB UNIT_KB*1024ULL +#define UNIT_GB UNIT_MB*1024ULL +#define UNIT_TB UNIT_GB*1024ULL +#define UNIT_PB UNIT_TB*1024ULL + +#define UNIT_KB_STRING "KB" +#define UNIT_MB_STRING "MB" +#define UNIT_GB_STRING "GB" +#define UNIT_TB_STRING "TB" +#define UNIT_PB_STRING "PB" + +int +string2bytesize (const char *str, unsigned long long *n) +{ + unsigned long long value = 0ULL; + char *tail = NULL; + int old_errno = 0; + const char *s = NULL; + + if (str == NULL || n == NULL) + { + errno = EINVAL; + return -1; + } + + for (s = str; *s != '\0'; s++) + { + if (isspace (*s)) + { + continue; + } + if (*s == '-') + { + return -1; + } + break; + } + + old_errno = errno; + errno = 0; + value = strtoull (str, &tail, 10); + + if (errno == ERANGE || errno == EINVAL) + { + return -1; + } + + if (errno == 0) + { + errno = old_errno; + } + + if (tail[0] != '\0') + { + if (strcasecmp (tail, UNIT_KB_STRING) == 0) + { + value *= UNIT_KB; + } + else if (strcasecmp (tail, UNIT_MB_STRING) == 0) + { + value *= UNIT_MB; + } + else if (strcasecmp (tail, UNIT_GB_STRING) == 0) + { + value *= UNIT_GB; + } + else if (strcasecmp (tail, UNIT_TB_STRING) == 0) + { + value *= UNIT_TB; + } + else if (strcasecmp (tail, UNIT_PB_STRING) == 0) + { + value *= UNIT_PB; + } + + else + { + return -1; + } + } + + *n = value; + + return 0; +} + +int main (int argc, char *argv[]) +{ + int ret = -1; + int fd = -1; + char *buf = "This is a string"; + char *filename = NULL; + unsigned long long size = 0; + + if (argc < 2) { + fprintf (stderr, "Usage:./a.out \n"); + return 2; + } + + filename = argv[1]; + + fd = open (filename, O_CREAT|O_RDWR, 0644); + if (fd == -1) { + fprintf (stderr, "OPEN: cannot open the file fff. (%s)", + strerror (errno)); + return 2; + } + + if (argc < 3) + size = 5 * UNIT_GB; + else + string2bytesize (argv[2], &size); + + ret = ftruncate (fd, size); + if (ret == -1) { + fprintf (stderr, "TRUNCATE: cannot truncate the file %s. (%s)", + filename, strerror (errno)); + goto out; + } + + printf ("File got truncated tp %llu bytes. Sleeping for 22 seconds. " + "Kill the brick.....\n", size); + + sleep (22); + + ret = lseek (fd, 1048576, SEEK_SET); + if (ret == -1) { + fprintf (stderr, "LSEEK: cannot seek to the offset file fff. " + "(%s)", strerror (errno)); + goto out; + } + + ret = write (fd, buf, strlen (buf)); + if (ret == -1) { + fprintf (stderr, "WRITE: cannot write to the file fff. (%s)", + strerror (errno)); + goto out; + } + + ret = 0; +out: + if (fd) + close (fd); + + return ret; +} -- cgit From 0fecd1f748e578cb247e10e81bec352c8cf97448 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Fri, 7 Oct 2011 18:37:09 +0530 Subject: helper_scripts/glusterfs_uninstall: scripts for uninstalling glusterfs scripts which uninstalls glusterfs on the local machine and on a set of machines. --- helper_scrips/INFO | 4 +++ helper_scrips/glusterfs_uninstall.sh | 46 +++++++++++++++++++++++++ helper_scrips/multi_uninstall.sh | 66 ++++++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100755 helper_scrips/glusterfs_uninstall.sh create mode 100755 helper_scrips/multi_uninstall.sh diff --git a/helper_scrips/INFO b/helper_scrips/INFO index c349fba..ad0d600 100644 --- a/helper_scrips/INFO +++ b/helper_scrips/INFO @@ -15,3 +15,7 @@ The above scripts are usable with the passwordless ssh connection setup between ============================================================================================================================================= helper_scripts/install_parallel_glusterfs.sh --------> executes the download_and_install.sh scripts prallely on multiple machines, such that glusterfs gets installed on multiple machines simultaneously. + +============================================================================================================================================= +helper_scrips/glusterfs_uninstall.sh ------> uninstalls the specified glusterfs version if it finds the source directory. +herper_scripts/multi_uninstall.sh -------> uninstalls the specified glusterfs from multiple machines, by executing glusterfs_uninstall.sh script. diff --git a/helper_scrips/glusterfs_uninstall.sh b/helper_scrips/glusterfs_uninstall.sh new file mode 100755 index 0000000..31a000d --- /dev/null +++ b/helper_scrips/glusterfs_uninstall.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +#set -x; + +function _init () +{ + # echo $0; + # echo $#; + # echo $1; + set -u; + if [ $# -lt 1 ]; then + echo "usage: download_and_install "; + exit 1; + fi + + version=$1; + echo $version; + echo $version | grep "glusterfs" 2>/dev/null 1>/dev/null; + if [ $? -ne 0 ]; then + echo "given argument is not glusterfs"; + exit 1; + fi +} + +function un_install () +{ + cd /root/$version; + + cd build; + make uninstall && make clean && make distclean; + + cd /root; +} + +main () +{ + + if [ ! -d $version ]; then + echo "the glusterfs version ($version) directory is not there." + return 1; + fi + + un_install; +} + +_init "$@" && main "$@" diff --git a/helper_scrips/multi_uninstall.sh b/helper_scrips/multi_uninstall.sh new file mode 100755 index 0000000..dca2350 --- /dev/null +++ b/helper_scrips/multi_uninstall.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +#!/bin/bash + +function _init () +{ + set -u; + VERSION=$1; +} + +function uninstall_glusterfs () +{ + local remote_server=; + + if [ $# -eq 1 ]; then + remote_server=$1; + fi + + if [ $remote_server ]; then + ssh $remote_server cp -f /root/scripts/glusterfs_uninstall.sh /root/; + ssh $remote_server /root/glusterfs_uninstall.sh $VERSION; + return 0; + fi + + j=0; + for i in $(cat /root/machines) + do + j=$(($j+1)); + (uninstall_glusterfs $i)& + done + +} + +function uninstall_my_glusterfs () +{ + old_PWD=$PWD; + + cd /root; + cp -f /root/scripts/glusterfs_uninstall.sh /root/; + /root/glusterfs_uninstall.sh $VERSION; + + cd $old_PWD; + return 0; +} + +function main () +{ + stat --printf=%i /root/machines 2>/dev/null 1>/dev/null; + if [ $? -ne 0 ]; then + echo "servers file is not present /root. Cannot execute further."; + + exit 1; + fi + + uninstall_glusterfs; + for i in $(1 $j) + do + wait %$j; + done + + uninstall_my_glusterfs; + + return 0; +} + +_init "$@" && main "$@" -- cgit From b535262e2e4105e67df260465851c8a9bc6ed5ae Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Mon, 10 Oct 2011 14:51:39 +0530 Subject: helper_scripts/rpm_download_install: script which downloads and installs glusterfs rpms This script not only installs the qa releases but also installs the main releases also. Can be even upgraded by giving option "yes". --- helper_scrips/rpm_download_install.sh | 152 ++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100755 helper_scrips/rpm_download_install.sh diff --git a/helper_scrips/rpm_download_install.sh b/helper_scrips/rpm_download_install.sh new file mode 100755 index 0000000..4bbbea5 --- /dev/null +++ b/helper_scrips/rpm_download_install.sh @@ -0,0 +1,152 @@ +#!/bin/bash + +#set -x; + +function _init () +{ + # echo $0; + # echo $#; + # echo $1; + set -u; + if [ $# -lt 1 ]; then + echo "usage: download_and_install [upgrade decision]"; + exit 1; + fi + + version=$1; + echo $version; + echo $version | grep "glusterfs" 2>/dev/null 1>/dev/null; + if [ $? -ne 0 ]; then + echo "given argument is not glusterfs"; + exit 1; + fi + + version_number=$(echo $version | cut -f 2 -d "-"); + check_if_qa_release $version; + op_ret=$?; + + if [ $op_ret -eq 0 ]; then + download_address="http://bits.gluster.com/pub/gluster/glusterfs/"; + else + echo $version | grep "3.2" 2>/dev/null 1>/dev/null; + if [ $? -eq 0 ]; then + version_number=$(echo $version | cut -f 2 -d "-"); + download_address="http://download.gluster.com/pub/gluster/glusterfs/3.2/$version_number/CentOS/"; + else + grep "3.1" $version 2>/dev/null 1>/dev/null; + echo "haha yes" + if [ $? -eq 0 ]; then + version_number=$(echo $version | cut -f 2 -d "-"); + download_address="http://download.gluster.com/pub/gluster/glusterfs/3.1/$version_number/CentOS/"; + else + grep "3.0" $version 2>/dev/null 1>/dev/null; + if [ $? -eq 0 ]; then + version_number=$(cut -f 2 -d "-" $version); + download_address="http://download.gluster.com/pub/gluster/glusterfs/3.0/$version_number/CentOS/"; + fi + fi + fi + fi + + echo "KK: $download_address" +# ls -l "$version".tar.gz 2>/dev/null 1>/dev/null +# if [ $? -ne 0 ]; then +} + +function check_if_qa_release () +{ + glusterfs_version=$1; + + echo $glusterfs_version | grep "qa" 2>/dev/null 1>/dev/null; + ret=$?; + + return $ret; +} + +function download_rpms () +{ + address=$1; + local ret; + + mkdir $PWD/rpms/$version_number; + + cd $PWD/rpms/$version_number; + + echo $version_number | grep "3.2"; + is_32=$?; + if [ $is_32 -ne 0 ]; then + echo $version_number | grep "3.3"; + is_32=$?; + fi + + check_if_qa_release $version; + ret=$? + + if [$ret -eq 0 ]; then + wget $address/$version_number/x86_64/glusterfs-core-$version_number-1.x86_64.rpm; + wget $address/$version_number/x86_64/glusterfs-debuginfo-$version_number-1.x86_64.rpm; + wget $address/$version_number/x86_64/glusterfs-fuse-$version_number-1.x86_64.rpm; + if [ $is_32 -eq 0 ]; then + wget $address/$version_number/x86_64/glusterfs-geo-replication-$version_number-1.x86_64.rpm; + echo "3.2 version"; + fi + else + wget $address/glusterfs-core-$version_number-1.x86_64.rpm; + wget $address/glusterfs-debuginfo-$version_number-1.x86_64.rpm; + wget $address/glusterfs-fuse-$version_number-1.x86_64.rpm; + if [ $is_32 -eq 0 ]; then + wget $address/glusterfs-geo-replication-$version_number-1.x86_64.rpm; + echo "3.2 version"; + fi + fi +} + + +function install_or_upgrade () +{ + cd /root/rpms/$version_number; + if [ $upgrade != "yes" ]; then + for i in $(ls) + do + rpm -ivh $i; + done + else + for i in $(ls) + do + rpm -Uvh $i; + done + fi + + ret=$?; + cd /root; + + ldconfig; + return $ret; +} + +main () +{ + echo $download_address; + download_rpms $download_address; + + upgrade="no"; + if [ $# -eq 2 ]; then + upgrade=$2; + fi + + if [ $upgrade != "yes" ] && [ $upgrade != "no" ]; then + echo "Invalid upgrade decision $upgrade"; + rm -rf /root/rpms/$version_number; + exit 1; + fi + + install_or_upgrade $upgrade; + ret=$?; + if [ $ret -ne 0 ]; then + rm -rf /root/rpms/$version_number; + fi +} + +_init "$@" && main "$@" + + \ No newline at end of file -- cgit From d5457aa0ba65d2a54ef310f1dd9e8adddb0fd465 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 13 Oct 2011 15:02:24 +0530 Subject: helper_scripts/install_glusterfs_rpm: script to install glusterfs rpm parallely on multiple machines installs the glusterfs rpm of specified version (can upgrade too depending upon the arguments), on multiple machines parallely. And also some changes to the rpm installing script helper_scripts/rpm_download_install. --- helper_scrips/INFO | 2 + helper_scrips/install_glusterfs_rpm.sh | 75 ++++++++++++++++++++++++++++++++++ helper_scrips/rpm_download_install.sh | 33 +++++++++------ 3 files changed, 98 insertions(+), 12 deletions(-) create mode 100755 helper_scrips/install_glusterfs_rpm.sh diff --git a/helper_scrips/INFO b/helper_scrips/INFO index ad0d600..d030697 100644 --- a/helper_scrips/INFO +++ b/helper_scrips/INFO @@ -19,3 +19,5 @@ helper_scripts/install_parallel_glusterfs.sh --------> executes the download_and ============================================================================================================================================= helper_scrips/glusterfs_uninstall.sh ------> uninstalls the specified glusterfs version if it finds the source directory. herper_scripts/multi_uninstall.sh -------> uninstalls the specified glusterfs from multiple machines, by executing glusterfs_uninstall.sh script. + +helper_scrips/install_glusterfs_rpm.sh -----> installs the specified glusterfs rpms on the machines whose list is provided in /root/machines,parallely \ No newline at end of file diff --git a/helper_scrips/install_glusterfs_rpm.sh b/helper_scrips/install_glusterfs_rpm.sh new file mode 100755 index 0000000..4e82b58 --- /dev/null +++ b/helper_scrips/install_glusterfs_rpm.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +function _init () +{ + set -u; + VERSION=$1; + if [ $# -lt 2 ]; then + upgrade="no"; + else + if [ $2 == "yes" ]; then + upgrade="yes"; + else + upgrade="no"; + fi + fi +} + +function install_glusterfs () +{ + local remote_server=; + + if [ $# -eq 1 ]; then + remote_server=$1; + fi + + if [ $remote_server ]; then + ssh $remote_server cp -f /root/scripts/rpm_download_install.sh /root/; + ssh $remote_server /root/rpm_download_install.sh $VERSION $upgrade; + return 0; + fi + + j=0; + for i in $(cat /root/machines) + do + j=$(($j+1)); + (install_glusterfs $i)& + done + +} + +function install_my_glusterfs () +{ + old_PWD=$PWD; + + cd /root; + cp /root/scripts/rpm_download_install.sh /root/; + /root/rpm_download_install.sh $VERSION $upgrade; + + cd $old_PWD; + return 0; +} + +function main () +{ + stat --printf=%i /root/machines 2>/dev/null 1>/dev/null; + if [ $? -ne 0 ]; then + echo "servers file is not present /root. Cannot execute further."; + + exit 1; + fi + + install_glusterfs; + for i in $(1 $j) + do + wait %$j; + done + + install_my_glusterfs; + + return 0; +} + +_init "$@" && main "$@" + + diff --git a/helper_scrips/rpm_download_install.sh b/helper_scrips/rpm_download_install.sh index 4bbbea5..f1a071a 100755 --- a/helper_scrips/rpm_download_install.sh +++ b/helper_scrips/rpm_download_install.sh @@ -31,24 +31,24 @@ function _init () echo $version | grep "3.2" 2>/dev/null 1>/dev/null; if [ $? -eq 0 ]; then version_number=$(echo $version | cut -f 2 -d "-"); - download_address="http://download.gluster.com/pub/gluster/glusterfs/3.2/$version_number/CentOS/"; + download_address="http://download.gluster.com/pub/gluster/glusterfs/3.2/$version_number/RHEL/"; else grep "3.1" $version 2>/dev/null 1>/dev/null; echo "haha yes" if [ $? -eq 0 ]; then version_number=$(echo $version | cut -f 2 -d "-"); - download_address="http://download.gluster.com/pub/gluster/glusterfs/3.1/$version_number/CentOS/"; + download_address="http://download.gluster.com/pub/gluster/glusterfs/3.1/$version_number/RHEL/"; else grep "3.0" $version 2>/dev/null 1>/dev/null; if [ $? -eq 0 ]; then version_number=$(cut -f 2 -d "-" $version); - download_address="http://download.gluster.com/pub/gluster/glusterfs/3.0/$version_number/CentOS/"; + download_address="http://download.gluster.com/pub/gluster/glusterfs/3.0/$version_number/RHEL/"; fi fi fi fi - echo "KK: $download_address" + echo "Download address: $download_address" && sleep 2; # ls -l "$version".tar.gz 2>/dev/null 1>/dev/null # if [ $? -ne 0 ]; then } @@ -68,7 +68,12 @@ function download_rpms () address=$1; local ret; - mkdir $PWD/rpms/$version_number; + if [ ! -d $PWD/rpms ] || [ ! -d $PWD/rpms/$version_number ]; then + mkdir $PWD/rpms/$version_number -p; + else + echo "the directory for the mentioned versrion $version_number is present"; + return; + fi cd $PWD/rpms/$version_number; @@ -82,7 +87,7 @@ function download_rpms () check_if_qa_release $version; ret=$? - if [$ret -eq 0 ]; then + if [ $ret -eq 0 ]; then wget $address/$version_number/x86_64/glusterfs-core-$version_number-1.x86_64.rpm; wget $address/$version_number/x86_64/glusterfs-debuginfo-$version_number-1.x86_64.rpm; wget $address/$version_number/x86_64/glusterfs-fuse-$version_number-1.x86_64.rpm; @@ -91,11 +96,11 @@ function download_rpms () echo "3.2 version"; fi else - wget $address/glusterfs-core-$version_number-1.x86_64.rpm; - wget $address/glusterfs-debuginfo-$version_number-1.x86_64.rpm; - wget $address/glusterfs-fuse-$version_number-1.x86_64.rpm; + wget $address/glusterfs-core-$version_number-1.el6.x86_64.rpm; + wget $address/glusterfs-debuginfo-$version_number-1.el6.x86_64.rpm; + wget $address/glusterfs-fuse-$version_number-1.el6.x86_64.rpm; if [ $is_32 -eq 0 ]; then - wget $address/glusterfs-geo-replication-$version_number-1.x86_64.rpm; + wget $address/glusterfs-geo-replication-$version_number-1.el6.x86_64.rpm; echo "3.2 version"; fi fi @@ -104,7 +109,11 @@ function download_rpms () function install_or_upgrade () { - cd /root/rpms/$version_number; + local old_PWD; + + old_PWD=$PWD; + + cd $PWD/rpms/$version_number; if [ $upgrade != "yes" ]; then for i in $(ls) do @@ -118,7 +127,7 @@ function install_or_upgrade () fi ret=$?; - cd /root; + cd $old_PWD; ldconfig; return $ret; -- cgit